Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 321111 - media-gfx/gimp takes over as default pdf application
Summary: media-gfx/gimp takes over as default pdf application
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Hanno Böck
URL: http://forums.gentoo.org/viewtopic-p-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-22 21:17 UTC by labor_ratte
Modified: 2011-09-02 20:49 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description labor_ratte 2010-05-22 21:17:29 UTC
No matter if gimp is emerged with or w/o the "pdf" use flag, it takes over as first/standard viewer for pdf files in my Gnome environment. If you click a link to a pdf file in firefox, there is only one choice to open with, and that is gimp. If I change the order in /usr/share/applications/mimeinfo.cache to evince first, i get to choose evince instead. (This is what I want!)

Also in the file browser (nautilus), I chose evince as default opener for pdf files, but after every emerge of gimp it gets set back to default to gimp.

Even if I omit the pdf use flag for gimp, after emerge gimp; the option to open pdf gets set back to default to gimp both in web and file browser. 

What I want: open pdf with evince as default both in nautilus and firefox.
What happens: I click on pdf's here and there and suddenly gimp starts up! (aargh!)

Discussed in fgo here:
http://forums.gentoo.org/viewtopic-p-6176893-highlight-.html#6176893

Please be aware that I am no native english speaker so I quite don't know how to get to the point.
Comment 1 DEMAINE Benoît-Pierre, aka DoubleHP 2010-10-17 14:21:51 UTC
previous topic: bug 275677 . 

Whatever Gimp is installed or not, or, if it's installed after xpdf ... Gimp should never be the first choice for opening a PDF. /usr/share/applications/mimeinfo.cache should always have things in THIS order: xpdf evince acroread gimp . Readers first, free first, lightest first.
Comment 2 Thomas Kahle (RETIRED) gentoo-dev 2010-12-30 10:58:33 UTC
I'm also constantly annoyed by this. Also the mime-info is rewritten frequently, I don't know how to make changes permanent...
Comment 3 DEMAINE Benoît-Pierre, aka DoubleHP 2010-12-30 11:30:33 UTC
Thomas, the change must be done by root in /usr/share/applications/mimeinfo.cache . The file is updated frequently; it does not belong to one particular ebuild, but several different ebuilds may update the file when calling a post-inst script.

The global choices *should* be over-written by user prefs: ~/.local/share/applications/mimeinfo.cache which can not be modified by root.
Comment 4 Thomas Kahle (RETIRED) gentoo-dev 2010-12-30 11:38:36 UTC
(In reply to comment #3)
> The global choices *should* be over-written by user prefs:
> ~/.local/share/applications/mimeinfo.cache which can not be modified by root.

My point is that this file is also rewritten frequently, e.g. on log-in by startkde init scripts.  One would probably need to hook into the scripts writing this cache.
Comment 5 DEMAINE Benoît-Pierre, aka DoubleHP 2010-12-30 11:41:05 UTC
I avoid this by NOT running KDE at all :)

The aim of this bug is to ask the script to stop their stupid behaviour ... 

But it will be fixed only when you propose a patch.
Comment 6 Thomas Kahle (RETIRED) gentoo-dev 2010-12-30 11:46:50 UTC
(In reply to comment #5)
> I avoid this by NOT running KDE at all :)

Same with gnome.

> The aim of this bug is to ask the script to stop their stupid behaviour ... 

Well, the mimeinfo.cache file does not contain any information that makes gimp open pdfs (at least here).  I would say this is not the problem.  It is a weird combination of things failing, I see this only when I click a pdf link in firefox, then it will be opened with gimp, although the preferred application is set to 'your choice here' in the firefox settings. I have no idea why.

if I run

xdg-open ${pdf-file}

then it opens correctly in a pdf reader, for me only firefox opens it in gimp, ignoring the choices I made in it's preferences or on the fly via "how to open a file" the dialog.

> But it will be fixed only when you propose a patch.

I will read that forum thread at some point ... maybe.
Comment 7 Thomas Kahle (RETIRED) gentoo-dev 2010-12-30 11:54:17 UTC
Another experiment:

If I select to open pdf's with /usr/bin/okular in firefox then gimp comes up
If I select to open with /usr/bin/xdg-open then okular comes up (as it should)

So that is a workaround for me.
Comment 8 Robert Coffree 2011-02-03 07:17:08 UTC
Is this not a design flaw? If two applications can support pdf, but one is better than the other, should not the default be that the former take PRECEDENCE! And yet, nowhere can a place to specify this precedence be found. 
Comment 9 DEMAINE Benoît-Pierre, aka DoubleHP 2011-02-03 14:19:56 UTC
The order is defined in the mime file; the order can be changer using vim, or a mime editor; the USER mime overrides the system one. Not a big deal.

We just need gentoo to put a "not so stupid order" in the default mime.
Comment 10 Robert Coffree 2011-02-05 08:12:01 UTC
That would a short term solution but not quite correct, and in fact this is also a problem on other distros.

When the mimeinfo is generated is looks at what is suppored by what. For some reason, due to g proceeding e in the latin alphabet you obtain gimp for pdf files, even though, almost everyone will agree that gimp is pretty useless at that job. The problem is at the time when the mimeinfo in generated, it doesn't know which application is best suited. So adding a hack like don't do this etc, is a short term solution. The problem is that the order for the mimetypes should  contain a confidence level - say gimp I am about 50% evince about 90 and acrobat about 80 etc.



> The order is defined in the mime file; the order can be changer using vim, or a
> mime editor; the USER mime overrides the system one. Not a big deal.
> 
> We just need gentoo to put a "not so stupid order" in the default mime.
> 

Comment 11 Sebastian Pipping gentoo-dev 2011-09-02 20:48:57 UTC
(In reply to comment #10)
> [..] For some reason, due to g proceeding e in the latin alphabet
> you obtain gimp for pdf files [..]

Excellent hint, thanks for sharing.  This bug was actually bothering me for some time, too.

Fixed with a workaround now:

  mv "${D}"/usr/share/applications/{,zzz-}gimp.desktop || die

Closing.


+*gimp-2.7.3-r1 (02 Sep 2011)
+*gimp-2.6.11-r4 (02 Sep 2011)
+
+  02 Sep 2011; Sebastian Pipping <sping@gentoo.org> +gimp-2.6.11-r4.ebuild,
+  +gimp-2.7.3-r1.ebuild:
+  Set precedence of Gimp on PDF files to zero (bug #321111)
+