Gimp is installed with an entry for application/pdf in /usr/share/applications/zzz-gimp.desktop. This consequently overrides the (sensible) bindings from any PDF reader. While one could argue that this misbehaviour is intrinsic to the insufficiently designed XDG specs, it would surely be reasonable to purge Gimp's binding to PDF for it's primarily not a PDF reader, whatsoever.
How is this a problem? If you have only GIMP installed and nothing else that wants to open PDFs, then this should be fine. If you have a preferred alternative, then your "desktop environment" should offer a choice between applications to open the PDF file with, and perhaps an option to select a default, or do nothing at all and fail gracefully. The GIMP desktop file is merely stating what it can do, not what the desktop environment should do.
Actually, on closer inspection I have to agree. Sure, gimp can import PDF files, but it complains about an unknown file type when you run `gimp /path/to/file.pdf'.
(In reply to comment #2) > Actually, on closer inspection I have to agree. Sure, gimp can import PDF > files, but it complains about an unknown file type when you run `gimp > /path/to/file.pdf'. Works fine over here, could it be you have Gimp installed with USE=-pdf or so? The reason we currently rename gimp.desktop to zzz-gimp.desktop is because other desktop environments (e.g. XFCE) collect MIME types and run the first app based on matching .desktop files sorted alphabetically. So zzz-gimp.desktop is meant to go very last and not ever hit while you have other apps supporting PDF around. If your desktop takes the last (rather than the first) match, we're in trouble I guess. What's your desktop environment?
Jeroen, I agree with Sebastian, you're probably lacking PDF support in GIMP. That said, I agree with your original closing the bug as invalid. My thought on this is that XDG has no specification on how precedence should be handled (unfortunally). That said, everything concerning precedence is implementation specific (and up to a DE to unify consistently). The .desktop files only specify which filetypes a application may open (if yours specify PDF whereas GIMP cannot handles those, that's surely a bug). Sebastian, I don't use any DE, without which GAppInfo [1] seems to decided to use the last entry (zzz...). [1] http://developer.gnome.org/gio/2.32/GAppInfo.html
(In reply to comment #4) > Jeroen, I agree with Sebastian, you're probably lacking PDF support in GIMP. No, USE=pdf.
There was something wrong with the PDF file I tested with. Sorry for any disturbance this may have caused. I'd still go with INVALID.
Created attachment 334676 [details] Tool to list installed applications supporting the given MIME type (In reply to comment #6) > There was something wrong with the PDF file I tested with. Thanks for clearing that up. (In reply to comment #4) > Sebastian, I don't use any DE, without which GAppInfo [1] seems to decided > to use the last entry (zzz...). > > [1] http://developer.gnome.org/gio/2.32/GAppInfo.html To my understanding, the function g_app_info_get_recommended_for_type returns the list of supporting applications in alphabetically ascending order, except with some selected applications moved to the very beginning (which calls to function g_app_info_set_as_last_used_for_type seem to be causing). I have written a small C program to list the list of supporting applications. the code is attached. Link and run it with: $ gcc -Wall -Wextra -o mimetest mimetest.c \ $(pkg-config --cflags gio-2.0) \ $(pkg-config --libs gio-2.0) $ ./mimetest application/pdf For me, the out is this: Applications supporting MIME type "application/pdf": [1] id = "kde4-okularApplication_pdf.desktop" name = "Okular" command line = "okular %U %i -caption "%c"" [2] id = "evince.desktop" name = "Document Viewer" command line = "evince %U" [3] id = "inkscape.desktop" name = "Inkscape" command line = "inkscape %F" [4] id = "zzz-gimp.desktop" name = "GNU Image Manipulation Program" command line = "gimp-2.8 %U" Okular goind first is a bit odd. I suppose the sub folder is due to that: /usr/share/applications/kde4/okularApplication_pdf.desktop /usr/share/applications/evince.desktop /usr/share/applications/inkscape.desktop /usr/share/applications/zzz-gimp.desktop Now if I make sure this content [Added Associations] application/pdf=inkscape.desktop;zzz-gimp.desktop; is in file ~/.local/share/applications/mimeapps.list the output changes to Applications supporting MIME type "application/pdf": [1] id = "inkscape.desktop" name = "Inkscape" command line = "inkscape %F" [2] id = "zzz-gimp.desktop" name = "GNU Image Manipulation Program" command line = "gimp-2.8 %U" [3] id = "kde4-okularApplication_pdf.desktop" name = "Okular" command line = "okular %U %i -caption "%c"" [4] id = "evince.desktop" name = "Document Viewer" command line = "evince %U" so my custom entries go first in specified order followed by the remaining apps in original order. Cedric, could you try the attached code and check the content of ~/.local/share/applications/mimeapps.list for any clues?
(In reply to comment #7) > Cedric, could you try the attached code and check the content of > ~/.local/share/applications/mimeapps.list for any clues? Closing as NEEDINFO after a month of no reply. Please re-open as needed.
Sebastian, excuse my not replying. I did not take notice of your response. mimeapps.list (or in my version of glib 2.32 defaults.list) works well and properly establishes a precedence among the installed applications which are capabable of opening a specific mimetype.
*** Bug 458594 has been marked as a duplicate of this bug. ***