GNOME Bugzilla – Bug 536530
gdk-pixbuf can not load svgz file.
Last modified: 2008-06-04 04:37:41 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.
I think bug 536414 depends on this one.
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.
I see. In my system, librsvg2 was built with SVGZ support. It should be a bug of librsvg2.
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
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"
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.
I see. But it should be fixed in some where (librsvg or gtk). Could we use gzip magic \037\213 to test svgz file?
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.
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
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.