Wassimulator / CactusViewer

A small single file image viewer written in C/C++.
BSD 2-Clause "Simplified" License
203 stars 15 forks source link

Unable to open a supported image after attempting to view an unsupported file #18

Open sir-pinecone opened 1 year ago

sir-pinecone commented 1 year ago

I found two related issues. I'll describe them separately.

1) If I try to open an unsupported file via the Open button - in this case a .RAF from FujiFilm - the app correctly tells me it's not supported. At this point I can no longer view supported images. I tried various types using the Open button and it continues to show the generic image thumbnail and the error message at the bottom status bar remains. The app title contains the name of the last image it was able to render (or nothing if the first thing I tried to open at app start was a .RAF).

2) If I try the above but I drag & drop the images instead then the app seg faults. Once an invalid image has been dropped (at cold open or after a valid), attempting to drop any valid or invalid image causes the app to crash. Note that the drag & drop crash does not happen when an invalid image has been first opened via the Open button. So there's something about putting the app into an invalid state with a drop that leads to a segfault on future image drops.

Hope the above isn't confusing. Let me know if you need any clarification or want this split into two separate issues.

sir-pinecone commented 1 year ago

Forgot to mention that I'm running Windows 10 and I'm seeing this behaviour on the pre-built release v2.1.1 and when building commit https://github.com/Wassimulator/CactusViewer/commit/2cca15cda using the b.bat script.

Benjipede commented 1 year ago

I get the same (also running on Windows 10), though for me dropping and using the open button seem interchangeable for both load of the invalid file and subsequent valid files. I can get out of error state by switching image via the arrow keys.

I should also mention that my invalid file was actually a BMP, but one freshly generated by Windows through the right-click menu.