[cairo] rsvg_handle_get_dimensions() problem

Andreas Falkenhahn andreas at airsoftsoftwair.de
Wed Mar 31 10:54:08 PDT 2010


Hi,

I noticed that rsvg_handle_get_dimensions() returns a dimension of 1x1 for many many
SVG files. Try this as an example:

http://upload.wikimedia.org/wikipedia/de/2/21/2010_FIFA_World_Cup_logo.svg

If you use:

rsvg-convert -o out.png (above file.svg)

you'll get a 1x1 PNG image in out.png. What seems to cause the problems here is
the following construction in the SVG:

<svg width="100%" height="100%" viewBox="0 0 340 375">

If you change that line to:

<svg width=340 height=375 viewBox="0 0 340 375">

it is working fine. It seems that librsvg has problems handling the percent specification
correctly. However, using percentage values for width/height is very common in SVGs
so I'm somewhat confused that such a crucial feature should be broken in librsvg?! 
Could this really be? What do the librsvg experts say? :)

Thanks,

Andreas
--
"Remember: It's nice to be important but it's more important to be nice!"




More information about the cairo mailing list