GNOME Bugzilla – Bug 346336
if user changes file extension, image still saved as PNG
Last modified: 2011-09-17 03:29:31 UTC
Please describe the problem: When you take a screenshot, the application lets the user change the filename where the picture will be saved. If the user changes "Screenshot.png" to "Screenshot.jpg", the application will save the file as "Screenshot.jpg" but put a PNG file inside. I think the application should not let the user change the file extension if it cannot save the image in other formats than PNG, or if it can save in other formats, it should parse the file extension and save in the right image type or complain if the extension is invalid. In any case, putting PNG data in an image with ".jpg" extension should not happen. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Dupe of 169450 perhaps.
the dialog should already highlight only the name and not the extension; if it does not, it's a bug - I'll investigate on that. leaving the support for other formats (as in "see bug #169450") aside, an extension is just a bunch of characters with no real meaning; extensions are just used for checking a file's MIME type faster than looking at its content: there is really no other use for them. so, I'm allowed to save a file with the ".this-is-a-png" extension and all that changes is that I'll have to make nautilus perform a slower check on the file contents. Emmanuel, if you want support for multiple formats add yourself as Cc: on bug #169450 (or, better, provide a patch for that :-)).
to be clear: definitely the name *with* extension is highlighted. and if you save a png with .jpg filename, nautilus does not provide a preview, though EOG does open the picture. various older programs might crash (not tested). so it makes a difference more than convention.
> to be clear: definitely the name *with* extension is highlighted. I committed a better check in HEAD; could you please test with it? > and if you save a png with .jpg filename, nautilus does not provide a preview, only until you click on it, because nautilus relies on the extension for a preliminary pass on the contents of a folder. as soon as the folder is loaded, a slower check is launched. > various older programs might crash (not tested). if an application crashes because uses only the extension and not the file magic bits then it's a bug of the application. this is not win32, and we've had the ability to retrieve the correct file type even without any extension at all for a very long time. anyway, this is still not a bug; if you select an image type in GIMP and then proceed to save the file with another extension, GIMP will do what you said and use your extension. since gnome-screenshot does not support (yet) multiple formats then if you change the extension you should know what you are doing, and we should not second guess you actions.
sorry, i'm just using the stable GNOME. I wrote this bug in the intent to protect the user against 1) assuming that gnome-screenshot supports multiple formats, which for now it doesn't; letting the user change the extension might make users think the support is there 2) removing the .png because of a poor knowledge of inner workings of computers. i think selecting only the name of the picture and keeping .png unselected is good enough. advanced users might still think they saved a JPG when changing .png to .jpg but if you don't think it's a bug it's fine with me. so you can close the bug if you want.
I'll take a chance to reopen this bug based on this question I encountered on LinuxExchange: http://linuxexchange.org/questions/2674/save-screenshot-as-jpeg-fedora-15 If Eye of Gnome saves files in whatever format indicated by the file extension, then surely gnome-screenshot can do it too?
Closing as a duplicate of bug 521751, as it's really the same thing. I think the user experience we want for gnome-screenshot now is a bit different though (see bug 652487), and we'll likely not show a dialog at all anymore in 3.4. *** This bug has been marked as a duplicate of bug 521751 ***