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 536530 - gdk-pixbuf can not load svgz file.
gdk-pixbuf can not load svgz file.
Status: RESOLVED WONTFIX
Product: librsvg
Classification: Core
Component: general
2.22.x
Other All
: Normal minor
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks: 536414
 
 
Reported: 2008-06-04 02:12 UTC by Peng Huang
Modified: 2008-06-04 04:37 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Peng Huang 2008-06-04 02:12:03 UTC
gdk-pixbuf supports loading svg file. But it can not load svgz file. svgz file is gzipped svg file. Currently, may icon themes use svgz icons. I think gdk-pixbuf should support it.

Thanks.
Comment 1 Peng Huang 2008-06-04 02:13:47 UTC
I think bug 536414 depends on this one.
Comment 2 Tor Lillqvist 2008-06-04 02:22:35 UTC
The svg loader is not part of GTK+. It is provided by librsvg. Whether the svg pixbuf loader can load svgz or not depends on how librsvg was configured.
Comment 3 Peng Huang 2008-06-04 02:43:55 UTC
I see. In my system, librsvg2 was built with SVGZ support. It should be a bug of librsvg2.
Comment 4 Dominic Lachowicz 2008-06-04 03:47:51 UTC
Make sure that librsvg was configured to use libgsf. As you can see from the below link, librsvg's gdk-pixbuf plugin supports SVGZ just fine. Sure, it can't auto-detect the format based on the file's contents, but that's because it's a generic gzip'd file, and gdk-pixbuf's detection mechanism isn't that intelligent.

http://svn.gnome.org/viewvc/librsvg/trunk/gdk-pixbuf-loader/io-svg.c?view=markup
Comment 5 Peng Huang 2008-06-04 04:03:30 UTC
Sorry. I don't understand why we can not fix it. 
I just edited file /etc/gtk-2.0/i386-redhat-linux-gnu/gdk-pixbuf.loaders as below, and then the gdk pixbuf can load svgz file. But, I don't know my editing if will cause other problems.

--- gdk-pixbuf.loaders.old	2008-06-04 11:54:41.000000000 +0800
+++ gdk-pixbuf.loaders	2008-06-04 11:49:15.000000000 +0800
@@ -85,6 +85,7 @@
 "svg" "svgz" "svg.gz" ""
 " <svg" "*    " 100
 " <!DOCTYPE svg" "*             " 100
+"" "" 100
 
 "/usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-pcx.so"
 "pcx" 4 "gtk20" "The PCX image format"
Comment 6 Dominic Lachowicz 2008-06-04 04:07:49 UTC
Because that "fix" you just pasted in will have librsvg try to render .doc files, .txt files, and anything else on your hard drive.

The fact that gdk-pixbuf's format detection algorithm isn't up-to-snuff isn't librsvg's problem.
Comment 7 Peng Huang 2008-06-04 04:16:13 UTC
I see. But it should be fixed in some where (librsvg or gtk). Could we use gzip magic  \037\213 to test svgz file?
Comment 8 Dominic Lachowicz 2008-06-04 04:19:18 UTC
With your proposed \037\213 fix, it would offer to "render" any gzip'd file, which is equally inappropriate (eg. "tar.gz")

GdkPixbuf's loader API doesn't give you the ability to "fix" content-type detection in librsvg.
Comment 9 Peng Huang 2008-06-04 04:30:43 UTC
Yeah. 
But comparing with not supporting svgz,  it's the best solution in current situation. I think most applications will not try to load any gz file as pixbuf. If some abnormal apps try to load gz file as pixbuf, rsvg gdk-pixbuf module will still check the content. I think for this situation, checking all gz files' contain in gtk or in rsvg module is not different, and does not have any performance issues. So I suggest trying to resolve this problem instead of wontfix.
Thanks
Comment 10 Dominic Lachowicz 2008-06-04 04:37:41 UTC
I disagree strongly with your assessment of the situation. Attempting to render any gzip'd file as an SVG is incorrect and potentially dangerous. It's much better not to do anything in these situations.

The loader supports SVGZ just fine if you do something like "gdk_pixbuf_loader_new_for_type()" and specify that you want to load SVGZ files. I have no idea how you're using the GdkPixbuf API, but you haven't bothered to mention that in your report.

Honestly, take this issue up with the GTK+ developers and remove me from this bug's CC list. You're not going to get anywhere by arguing with me and your comments haven't added any new, useful information.