Changing file type in Save As dialog has no effect

Bug #2001927 reported by grofaty
6
This bug affects 1 person
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.

Revision history for this message
James Carroll (james-carroll) wrote (last edit ):

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.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Yep, I think this is the behaviour of the GTK file picker, so I'm not sure Pinta can do much about it since the native file picker is used on all platforms (we don't even have the ability to read which file filter was selected when saving). It should presumably be consistent with every other application on the user's system

This is related to bug 1958670, where Pinta should not be changing the file name given to it by the dialog.

Revision history for this message
grofaty (grofaty) wrote :

Paint on Windows 10 having "file.png" in Save As dialog and change file type from menu to jpg and file name automatically changes to "file.jpg".

In LibreOffice (installed by default on Ubuntu 22.10) in Save As dialog there is no file extension visible in Name field. When changing file type from menu in Name field nothing visible changes (because file extension is not displayed), but file after saved it does changes file extension to Save As file type selection menu.

But in Pinta what ever is selected in Save AS file type selection menu has absolutely no effect.

Revision history for this message
grofaty (grofaty) wrote :

I have now installed LibreOffice from flatpak and the same behavior as LibreOffice default package in Ubuntu 22.10. File extension is not displayed, but when selection is made from file type menu, selection is respected.

Revision history for this message
James Carroll (james-carroll) wrote :

Paint on Windows 10 acting differently to Windows 11 is strange, maybe there's a user setting difference or an intentional change of UX between the two releases.

Having looked at LibreOffice on Ubuntu 22.04, it follows the Windows 11 Paint pattern of not showing the file extension at all. The default file name is "Untitled 1" and moving the MIME types around doesn't add an extension at all.

Where it does differ to Pinta is that if the file extension exists (i.e because it's added by the user manually) but the MIME type disagrees, then the extension is replaced with what the MIME suggests.

Considering the constraints imposed by the Portals for Pinta, the solution in terms of UX so that the MIME type selector has the effect is likely:

- For files that haven't been saved at all, the default name should be "Untitled Picture" with no extension
- For files that have been saved already but save as is being used to create a second version, no default filename is used.

Possibly, considering changing only those for the Linux release, since the other platforms don't seem to suffer this problem.

Revision history for this message
grofaty (grofaty) wrote :

James, you are right. I have dig into Windows 10 settings:
1. File Explorer
2. View menu
3. Options button
4. View tab
5. In "Advanced setting options" section check/uncheck "Hide extensions for known file types".

In my case it is unchecked, but default is checked. I am sure I have unchanged this settings, because this is one of the first thing I change after new Windows is installed.

To recap, by default in Paint/Windows there is no file extension in "File name" field, but extension is automatically added according to the file type selection menu. By default in "File name" field of "Save As" dialog it is displayed "Untitled", if "PNG" is selected from "Save as type" field .png is added to the end of file name and file name becomes "Untitled.png". If I select "JPG" from "Save as type" then file becomes Untitled.jpg.

But on Pinta "Save as" dialog what ever user selects from file type drop down menu it has zero effect. That I think is a bug, having some selection with no effect is the same as not having the selection at all.

Changed in pinta:
milestone: none → 2.2
Changed in pinta:
milestone: 2.2 → 2.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.