CactusViewer icon indicating copy to clipboard operation
CactusViewer copied to clipboard

Size Limit, Memory Leak, UI Crash

Open CaiB opened this issue 1 year ago • 0 comments

I attempted to load a 5709 x 20199 pixel PNG file, but Cactus does not appear to be able to handle an image of this size.

While encountering this, I found several bugs that I think should be resolved:

  1. UI crash: If Cactus is launched with an image that is too large, the window is completely black and unresponsive, giving no indication of what the problem is (even the error message at the bottom is missing)
  2. Memory leak: Attempting to open the image with a running instance of Cactus appears to allocate the RAM to hold the buffer, and does not free it even when subsequent images are loaded, or the same image is attempted again
  3. (Minor) Even if the image fails to load, the yellow "Loading image..." text does not disappear
  4. (Same as 1?) Resizing the window in this state causes the UI to die, and leave only a black screen

The image is valid, and the Windows 10 built-in viewer and Photoshop can open it with no trouble. Cactus does appear to be able to generate and show a thumbnail for this image regardless.

Here's a short GIF of points 2-4 demonstrated: cactus-is-cactus

CaiB avatar Aug 12 '24 13:08 CaiB