SVG mystery

4.3x testers have reported that some SVG images do not display in ROX or Viewnior.

Those in /usr/local/lib/X11/themes/FlatOrange do.

Newer ones, such as created in Inkscape, do not.

I wondered if perhaps 'librsvg', which is the package that provides SVG support for GTK, needed to be compiled with its optional dependency 'libcroco' (provides support for SVG images that have CSS formating).

So, I compiled libcroco 0.6.2 and recompiled librsvg 2.22.3. Nup, same problem.

So, I grabbed the latest librsvg, 2.26.0, but still no good.

Then I tried this ('rsvg-view' is a utility in the librsvg pkg):

# rsvg-view <svg file>

...hey, it displays!

So, librsvg itself is okay, GTK is somehow the problem.
If I try to open one of the newer SVG files in Viewnior, it reports an "unrecognised file format". C**p.

So, I wondered, just what is different between the SVG files that do display, and those that don't?

I have one that doesn't, 'brasero.svg', the first few lines of the file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.0"
width="48"
height="48">
<defs
id="defs3">
<linearGradient
id="linearGradient5349">


/usr/local/lib/X11/themes/FlatOrange/camera.svg works, here are the first few lines:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!-- Created with Inkscape ("http://www.inkscape.org/") -->
<svg
version="1.0"
x="0.0000000"
y="0.0000000"
width="162.50000"
height="162.50000"
id="svg183"
sodipodi:version="0.32"
inkscape:version="0.36"
sodipodi:docname="/usr/local/lib/X11/themes/Outline-svg/camera.svg"
sodipodi:docbase="/usr/local/lib/X11/themes/Outline-svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink">
<sodipodi:namedview


So guess what? I copied that "DOCTYPE" declaration from camera.svg, pasted it into brasero.svg -- now brasero.svg displays!

My memory of the SVG standard is that it needs that DOCTYPE declaration. So how come all the recent SVG images I have downloaded, created by Inkscape, don't have it? I just checked something, compiled GTK 2.16.6, still the same problem.

So, I am stuck with a mystery. I have a workaround, but really when we download SVG images we want them to display as-is, not have to edit them. Anyone got a solution? As things stand, I will have to go to 431-final with this not properly resolved.


Posted on 13 Oct 2009, 10:35


Comments:

Posted on 13 Oct 2009, 13:44 by magerlab
fbpanel' svg images....
i use fbpanel with openbox,pekwm or xfwm4
it has some images inside the packages
and some of them ( e.g. for rox-filer) are seen but some do not
and guess :)
the images that are shown in rox or fbpanel have DOCTYPE lines also
maybe it's possible to write a script to add these line to svg images:)?


Posted on 13 Oct 2009, 14:22 by downsouth
gimageview
Downloaded Logo-Brasero.svg & added doc line & saved as brasero.svg. Tried several viewers and only gimageview-0.2.27 (573k in ibiblio pup4 repo) would open both (using pup 421).


Posted on 13 Oct 2009, 15:24 by BarryK
Inkscape
Here are the release notes for Inkscape 0.41:

http://wiki.inkscape.org/wiki/index.php/ReleaseNotes041

They state, under "Important bugfixes":

Inkscape SVG documents no longer include DOCTYPE declaration with an URI of an SVG DTD; this DTD would not be able to validate our documents anyway (due to extension elements), and was just useless.



Posted on 13 Oct 2009, 15:39 by BarryK
SVG and SeaMonkey
SVG images display ok in SeaMonkey. I had compiled SeaMonkey to use the librsvg plugin rather than its own native SVG module.

So the problem is for apps that use gdk_pixbuf in GTK (such as Rox and Viewnior). GTK wants that DOCTYPE line. The Inkscape people took it out.

Maybe the latest GTK has sorted it out, but I have to leave it at that.



Posted on 13 Oct 2009, 15:45 by BarryK
Minimum DOCTYPE
I found inserting just this is enough:

<!DOCTYPE svg PUBLIC "" "">



Posted on 13 Oct 2009, 18:18 by ljfr
shared-mime info
it may be solved by updating shared-mime-info,
see post in:
http://www.murga-linux.com/puppy/viewtopic.php?p=350768#350768


Posted on 13 Oct 2009, 19:23 by ICPUG
Inkscape and SVG images
Barry,

If your memory is correct and the SVG spec demands a DOCTYPE declaration then the Inkscape project should be told they have solved their bug in the wrong way.

They should simply remove the URI rather than the whole DOCTYPE declaration - like your post above.


Posted on 13 Oct 2009, 21:00 by BarryK
Solution
Solution posted here:

http://puppylinux.com/blog/?viewDetailed=01166