Ginj-capture / Ginj

Ginj capture
GNU General Public License v3.0
26 stars 7 forks source link

Possible name/filetype saving anomaly/bug when saving as png/jpg? #67

Open qu0zz opened 3 months ago

qu0zz commented 3 months ago

First go to settings>manage targets, select Save>Edit, click on "Select format on save", Finish, Close, close Perform capture select jpg as filetype from dropdown. Despite selecting jpg the extension shown in the filename box still shows png as the extension on the filename. If you've selected jpg it should change the extension type to jpg in the filename box as xxxxxx.jpg (Don't overtype the file extension in the name box) and save it. At that point you may think it would perhaps save a jpg, but it doesn't, it saves an actual png encoded as a png. It follows the filename extension shown for saved file type. Now do the same but in the save box overtype the letters png with jpg and it saves a jpg Furthermore if you select png as the file type to save but overtype the extension letters in the filename box to jpg (expecting it would save a png for which the extension is wrongly named, it doesn't, it saves a jpg. So to summarise, making sure the extension in the filename box changes to the selected type would (maybe?) fix this , BUT, and it may be intended, overwriting the extension letters in the filename box trumps the file type selected, I can see that may be deliberate - in other words overwriting the extension letters in the filename box may deliberately change the filetype saved (which is very clever although considered anomalous by some depending on what you're used to) (I would expect the filetype to always reflect the type chosen no matter what I named it, but I can see a case both ways)

vicnevicne commented 3 months ago

Yeah, I admit the behaviour isn't clear. As far as I remember, "Select format on save" just relies on the extension of the selected file to choose the encoding. The file type selected in the dropdown box acts as a filter on what files are displayed, but has no effect on the encoding. Changind this file type should change the file extension in the proposed filename though. Once that works, I guess it will work as expected. So yes, I consider that a bug. I'll have a look at it but don't hold your breath ;-)

qu0zz commented 3 months ago

Thanks vicnevicne, yes agreed if selecting the filetype then populated the text field with the chosen extension that would be slightly clearer.. I've also noticed that if you type in a filename without an extension it ALWAYS defaults to a png and names it as such even if the previous save was a jpg.

haha, I'm not holding my breath, I might forget when to stop..