GregAlt / SolarFinish

App to apply finishing touches to solar images
MIT License
5 stars 3 forks source link

bug - cannot save file without explicit extension #6

Closed flyingbarron closed 10 months ago

flyingbarron commented 10 months ago

When trying to save a file without explicitly giving an extension the UI silently fails (does not save the file, does not raise an error)

The command line/console log says:


writing: D:/SharpCap Captures/2024-01-16/Sun/AS_P75/2024-01-16-0853_3-Sun_Red_lapl4_ap1955_conv-enhancedcolor-redline
Error: Failed to save D:/SharpCap Captures/2024-01-16/Sun/AS_P75/2024-01-16-0853_3-Sun_Red_lapl4_ap1955_conv-enhancedcolor-redline, likely bad file extension. Try .PNG

OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp:696: error: (-2:Unspecified error) could not find a writer for the specified extension in function 'cv::imwrite_'
GregAlt commented 10 months ago

try the latest. I switched it so that save filepicker forces png or tif/tiff. It's theoretically possible to save a .png file without an extension, but the underlying image library doesn't support it directly. It determines the file format from the file extension and throws an exception if it doesn't understand, which includes absence of extension. But now it shouldn't be possible to get that exception - the filepicker automatically adds png if you omit it.

flyingbarron commented 10 months ago

Thanks!