site  contact  subhomenews

SVG mystery

October 13, 2009 — BarryK
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 ( -->

/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"
<!-- Created with Inkscape ("") -->

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.


fbpanel' svg images....
Username: magerlab
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:)?

Username: BarryK
"Here are the release notes for Inkscape 0.41: They state, under "Important bugfixes": [i]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.[/i]

SVG and SeaMonkey
Username: BarryK
"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.

Username: BarryK
"I found inserting just this is enough: <!DOCTYPE svg PUBLIC "" "">

shared-mime info
Username: ljfr
"it may be solved by updating shared-mime-info, see post in:

Inkscape and SVG images
Username: ICPUG
"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.

Username: BarryK
"Solution posted here:

Tags: woof