All the EPS files ("Encapsulated PostScript image") I create using IDL are recognized as postscript ("PostScript document" or application/postscript). It means I cannot open them by double-clicking in nautilus. The header of the EPS files looks like this : %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 0 1020 340 %%Title: Graphics produced by IDL %%Creator: IDL Version 5.6 (linux x86 m32) %%CreationDate: Tue Mar 8 17:24:29 2005 %%DocumentData: Clean7bit %%Requirements: color %%LanguageLevel: 1 %%PageOrder: Ascend %%Pages: (atend) %%DocumentNeededResources: (atend) %%EndComments %%BeginPreview: 128 128 8 328
Created attachment 2333 [details] Override.xml (for correct eps sniffing)
The mime-type image/x-eps needs to have a higher magic priority than application/postscript (because it is more specific). Currently both have a magic-priority of 50. I fixed this problem by simply increasing the priority of image/x-eps to 51. (See attached override.xml file) This allows eps files to be associated with an application in nautilus (and then be opened by simply double clicking on them). Cheers, Chris
Can you please explain where is the file I need to modify to make this work ? I looked in /usr/share/mime/image/x-eps.xml but it says "created automatically, do not edit, bla bla".
You need to put it in the /usr/share/mime/package and to run update-mime-database /usr/share/mime Or maybe you need to modifiy freedesktop.xml.in to use the content of this file instead of the current definition for eps file (if there's any).
It works. You are my hero.
Since eps is a subset of postscript, rather than changing the priority, a better fix would be to make image/x-eps a subclass of application/postscript: <mime-type type="image/x-eps"> <sub-class-of type="application/postscript"/> <comment>Encapsulated PostScript image</comment> <comment xml:lang="az">Encapsulated PostScript r??smi</comment> <comment xml:lang="cs">Obr??zek v zapouzd??en??m Postscriptu</comment> <comment xml:lang="cy">Delwedd PostScript wedi ei chrisialu</comment> <comment xml:lang="de">EPS-Bild</comment> <comment xml:lang="el">???????????? Encapsulated PostScript</comment> <comment xml:lang="fi">kapsuloitu PostScript-kuva</comment> <comment xml:lang="fr">image encapsul?? PostScript</comment> <comment xml:lang="hu">Encapsulated PostScript-k??p</comment> <comment xml:lang="ko">???????????? ????????????????????? ?????????</comment > <comment xml:lang="nl">Ingekapselde Postscript afbeelding</comment> <comment xml:lang="nn">Encapsulated PostScript-bilete</comment> <comment xml:lang="sr">?????????????????? ???????????????????? ?????????? (E PS)</comment> <comment xml:lang="sv">Inkapslad PostScript-bild</comment> <magic priority="50"> <match value="%!" type="string" offset="0"> <match value="EPS" type="string" offset="15"/> </match> <match value="\004%!" type="string" offset="0"> <match value="EPS" type="string" offset="16"/> </match> </magic> <glob pattern="*.eps"/> <glob pattern="*.epsi"/> <glob pattern="*.epsf"/> </mime-type> </mime-info> This would allow eps files to be opened with the default postscript viewer. I've attached my Override.xml file (in case anyone wants to fix this themselves). Simply place it in /usr/share/mime/packages and sudo update-mime-database /usr/share/mime
Created attachment 2344 [details] subclass image/x-eps as application/postscript
Actually I think you need to make both changes. Declaring eps as a subclass of ps is good because it means that you inherit all the application associations given to generic postscript. Raising the priority of the magic pattern for eps is needed because otherwise when you go to the nautilus properties window for a valid eps file it will be listed as type application/postscript (not image/x-eps). This bug has also been reported in Debian, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=259652
I marked eps files as a subclass of postscript files (Christopher, I trust you when you say they are valid postcript files, I have no idea on the matter for my part ;). I haven't tested if this solves the magic sniffing issue, but I don't think t's worth raising the magic, the magic pattern for .eps files match a subset of .ps files and has the same priority, so imo the file should be sniffed as an eps file and not a ps one. I have to check what the code does, and bring the issue on xdg mailing list if it's not behaving as I expect.
Created attachment 2439 [details] [review] patch to xdgmime which fixes the issue I committed this patch to xdgmime, together with the subclass-of patch this should fix the issue.
Marking as fixed.
*** Bug 3166 has been marked as a duplicate of this bug. ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.