GNOME Bugzilla – Bug 472975
EOG should intelligently guess whether to use PNG or JPG when the user doesn't specify an extension/file format.
Last modified: 2021-06-19 08:47:15 UTC
+++ This bug was initially created as a clone of Bug #427806 +++ from comment 15: One could argue that the user should be pointed to the file format filter dropdown box in the filechooser, but this box is visible only when the user has expanded it, and then still it's unobvious. Instead I propose to "do the right thing" and select a proper extension when the user didn't specify it. Is it possible to detect whether an image is likely a photograph or line art? Perhaps GIMP or Inkscape already contain such an algorithm and it could be used to choose either PNG or JPG. If it's too difficult then we should go for the lossless option, namely PNG.
*** Bug 538141 has been marked as a duplicate of this bug. ***
Is it too much of an ugly hack to extract the file extension from the original file name and use that?
More than an ugly hack, the problem is that eog is able to open more file formats than what it can save. The alternative that some people propose is to choose between a standard lossless format (PNG) when the original image is in a lossless format or JPEG otherwise.
Would it still be an ugly hack to detect the file type based on the file extension of the original? Also, I'm pretty new to open source/gnome/bugzilla, is this bug tracker the right place to ask questions like this?
(In reply to comment #4) > Would it still be an ugly hack to detect the file type based on the file > extension of the original? It's better to do it using the mimetype detection. Some files may have a .bmp extension but actually be a JPEG file. > Also, I'm pretty new to open source/gnome/bugzilla, > is this bug tracker the right place to ask questions like this? If it's about approachs to solve issues in EOG or to comment on implementation proposals, yes, it's fine. If you have more general questions (programming, gtk+, fetching code from SVN, etc.) I recommend you to use the gnome-love@gnome.org mailing list.
Is the full list of file types we can write to the list presented in the Save As dialog, i.e. tif, png, jpg, ico, bmp? I assume we should respect that setting if the user has chosen one from the list but not added the file extension?
Currently, the image format detection implemented to fix bug 427806 occurs in the save_response_cb(...) function in eog-file-chooser.c. In order to automatically insert a new, suitable file extension in this function or before it is called the image file GFile pointer must be passed to this function somehow. What is the best way to do this?
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/eog/-/issues/ Thank you for your understanding and your help.