woelper / oculante

A fast and simple image viewer / editor for many operating systems
https://github.com/woelper/oculante
MIT License
1.04k stars 45 forks source link

Pressing "Reset all edits" in edit-ui results in empty image #472

Open B-LechCode opened 1 month ago

B-LechCode commented 1 month ago

Describe the bug Pressing "Reset all edits" in edit-ui results in empty image. This will create a panic due to zero division in TextureWrapper.

To Reproduce Steps to reproduce the behavior:

  1. Start Oculante
  2. Load an image
  3. Open edit ui
  4. Press "Reset all edits"
  5. Panic...

Expected behavior Resetting all edits should trigger switching back to the original texture and disabling the display button for the edited image in the compare section.

B-LechCode commented 1 month ago

Found this while working on #469, therefore zero texture size supression was implemented in the fix. If #471 is merged, the Bug mentioned will result in an empty screen.

woelper commented 1 month ago

If I remember correctly, there are result_pixel_opand result_image_op for caching reasons which should be set to 0 if the EditState is reset. In the past, they would be filled with the original image on the next frame so I can see how that became a problem...