After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790191 - Avoid Encapsulated PostScript (EPS) files
Avoid Encapsulated PostScript (EPS) files
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
3.26.x
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-11-10 20:55 UTC by Umang Jain
Modified: 2017-12-31 17:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
search-type-manager: Avoid .eps files (2.53 KB, patch)
2017-11-10 20:58 UTC, Umang Jain
committed Details | Review
Sample .eps file (77.34 KB, image/x-eps)
2017-12-08 18:57 UTC, Umang Jain
  Details
search-type-manager: Avoid Encapsulated PostScript (EPS) files (3.29 KB, patch)
2017-12-31 17:18 UTC, Debarshi Ray
committed Details | Review

Description Umang Jain 2017-11-10 20:55:35 UTC
<rishi> Yeah, EPSes are a problem. Tracker considers those as images, but to open them you need evince. :/
<rishi> Need to do something there. Maybe blacklist them?
<rishi> Like GIFs.
Comment 1 Umang Jain 2017-11-10 20:58:52 UTC
Created attachment 363375 [details] [review]
search-type-manager: Avoid .eps files
Comment 2 Debarshi Ray 2017-12-08 18:08:00 UTC
Do you have a sample EPS file that you could attach here?
Comment 3 Umang Jain 2017-12-08 18:57:40 UTC
Created attachment 365268 [details]
Sample .eps file

Sample .eps file which is currently sitting on my disk.

While running gnome-photos I get:
(gnome-photos:9706): gnome-photos-WARNING **: 00:25:17.278: Unable to create thumbnail: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._gdk_2dpixbuf_2derror_2dquark.Code3: Couldn’t recognize the image file format for file “/home/uajain/Downloads/gnome-fosdem-2017-measured.eps”
Comment 4 Debarshi Ray 2017-12-31 17:18:04 UTC
Review of attachment 363375 [details] [review]:

Thanks for fixing this. It looks correct to me.

::: src/photos-search-type-manager.c
@@ +97,3 @@
+  blacklist = g_strdup ("nie:mimeType(?urn) != 'image/x-eps' && nie:mimeType(?urn) != 'image/gif'");
+
+  item_filter = g_strdup_printf ("(fn:contains (?type, 'nmm#Photo') && %s)", blacklist);

We could even turn this into an array of blacklisted MIME types, to minimize future code changes when we add or remove a type.
Comment 5 Debarshi Ray 2017-12-31 17:18:58 UTC
Created attachment 366125 [details] [review]
search-type-manager: Avoid Encapsulated PostScript (EPS) files

Turned it into an array and pushed to master.