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 648815 - SVGZ icons in notification GNOME3
SVGZ icons in notification GNOME3
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-27 22:18 UTC by Łukasz
Modified: 2015-04-30 19:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdk-pixbuf-io: treat application/gzip like text/plain (1.27 KB, patch)
2015-04-19 23:12 UTC, Alberts Muktupāvels
none Details | Review
gdk-pixbuf-io: treat application/gzip like text/plain (1.08 KB, patch)
2015-04-20 12:17 UTC, Alberts Muktupāvels
committed Details | Review

Description Łukasz 2011-04-27 22:18:18 UTC
I want give a suggestion to add support icons in format SVG and SVGZ to "notify deamon" in GNOME3.
Comment 1 Bartosz Brachaczek 2011-07-27 10:18:31 UTC
notification-daemon supports SVG. Only SVGZ is unsupported. GNOME Shell is also affected, see bug #655403. Please rename to indicate that the problem affects only SVGZ.
Comment 2 André Klapper 2012-04-03 13:46:39 UTC
Mass-fixing incorrect assignee and QA contact scheme for notification-daemon so interested people can follow its development. (See 606364#c1 for ref.)
Comment 3 Alberts Muktupāvels 2015-04-16 17:37:54 UTC
librsvg supports svgz files, but gdkpixbuf fails to load images with .svgz extension.

There are multiple calls to _gdk_pixbuf_get_module when using gdk_pixbuf_new_from_file_at_size function to load file. Adding debug info in _gdk_pixbuf_get_module function at first call it returs 'image/svg+xml', but in second call it returns 'application/gzip' mime type for *.svgz file.

Probably this is not bug with gdkpixbuf, but with gio or librsvg:
1. gio function g_content_type_guess returns wrong mime type based on data (gdkpixbuf first tries to get mimetype based on data not filename).
2. librsvg simply are missing one more mime type in pixbuf loader - application/gzip.

image/svg+xml-compressed is subclass of application/gzip.
Comment 4 Matthias Clasen 2015-04-19 22:57:05 UTC
It would make sense to treat application/gzip like text/plain in _gdk_pixbuf_get_module, and retry with the filename in that case.
Comment 5 Alberts Muktupāvels 2015-04-19 23:12:27 UTC
Created attachment 301947 [details] [review]
gdk-pixbuf-io: treat application/gzip like text/plain

Your suggestion works. :)
Comment 6 Matthias Clasen 2015-04-20 12:10:31 UTC
Review of attachment 301947 [details] [review]:

::: gdk-pixbuf/gdk-pixbuf-io.c
@@ +899,3 @@
+        application_gzip = g_str_equal (mime_type, "application/gzip");
+
+        if ((uncertain || text_plain || application_gzip) && filename != NULL) {

I would prefer to keep the strcmp's inline so we don't do them unnecessarily
Comment 7 Alberts Muktupāvels 2015-04-20 12:17:50 UTC
Created attachment 301989 [details] [review]
gdk-pixbuf-io: treat application/gzip like text/plain
Comment 8 Matthias Clasen 2015-04-30 19:54:16 UTC
Review of attachment 301989 [details] [review]:

ok, thanks