Changing file type in Save As dialog has no effect
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pinta |
New
|
Undecided
|
Unassigned |
Bug Description
Pinta 2.1 flatpak on Ubuntu 22.10.
1. New image and draw something on canvas.
2. File | Save As.
3. Leave default. At my site it is JPEG image at bottom right and default image name is "Unsaved Image 1.jpg". Click on Save image.
4. JPEG Quality dialog appears. Accept default with OK button.
5. File | Save As.
6. In bottom right select PNG.
7. First problem appears. I expect that file name in Name field should change from .jpg to .png, but in my case it does not change it is displayed "Unsaved Image 1.jpg".
8. Click on Save button.
9. Now dialog appears with message: A file named "unsaved Image 1.jpg" already exits. Do you want to replace it?. I clicked on Replace button.
10. JPEG Quality dialog appears. Now it is obvious that for some reason step 6 was not taken into consideration and actually .jpg is the file type I am saving into.
Changed in pinta: | |
milestone: | none → 2.2 |
Changed in pinta: | |
milestone: | 2.2 → 2.3 |
The gist seems to be that if the filename has an extension, the extension is preferred. If the filename doesn't have an extension, the MIME type selected in the bottom right is used.
Comparing to Paint on Windows 11, that seems to roughly match the behaviour there. If the filename is "test.png", but the Mimetype is "jpg", it's saved as a .png.
What Windows does do differently, is it never actually shows you the file extension to begin with. And if you do add the extension and then change MIMEtype, it doesn't change from one to the other, it actually just hides the extension entirely again.
It's not something I've personally ever thought about, but thinking back on it, I personally rarely interact with with the MIMEtype for save actions, I always just change the extension (even if it's originally invisible), but I'm a computer savvy individual; and maybe the majority of users are otherwise inclined.
It may be the solution here is to not append the ".jpg" by default at all, if I recall correctly, the original concern was Pinta wouldn't be able to find and load image files without an extension, but those issues have since been fixed.
Ultimately I suppose it's a matter of platform convention and UX with no clear answer, and I'd expect if you tried this on KDE with the KDE filepicker, it might not have this problem. If I remember correctly, KDE would replace the file extension on the name automatically when you swapped MIMEtype.