PetitTournesol / Edgeware

Elsavirus inspired fetishware, built from the ground up to use interchangeable packages for better user experience.
MIT License
130 stars 96 forks source link

Bug introduced in 2.4.2 -- Checking "Popup Subliminals" checkbox causes images to not display #24

Open puppy-brain opened 1 year ago

puppy-brain commented 1 year ago

See title for description.

Steps to reproduce:

  1. With any config, start up edgeware, ensuring that the "Popup Subliminals" option is checked
  2. Note that while videos may play fine (if you've fixed the issue locally), no images appear.

After some troubleshooting, it appears that this line is the source of the issue: https://github.com/PetitTournesol/Edgeware/commit/dfb39535b730c94ab9a123df47e8aae5c3a88335#diff-10f8dad5d7af5b7ef7514f81ae610c0c83975b52e2d0c78841a9cc7f8e8b774cR303

Not 100% sure the technical explanation, but apparently passing a closed file to GifLabel.load() as the back_image parameter causes some problems. The load function will complete fine, but for some reason or another the self.frames object will just be an empty array. As a result, self.frames_ that is generated from the cycle class will look a bit weird, and when we go to call next(self.frames_) in the GifLabel.next_frame method, an exception is thrown. This causes the whole popup process to fail and no image to be displayed.

tl;dr: moving resized_image.close() from line 303 where it is currently to line 375 instead resolves the issue. would be happy to submit a pull request if added with no approval to merge.