GNOME Bugzilla – Bug 143300
wrong bounding box when importing SVG
Last modified: 2010-04-16 23:05:03 UTC
The attached SVG doesn't gets chopped off when imported to GIMP. the rsvg utility doesn't seem to have problems with it.
Created attachment 28092 [details] SVG icon
Created attachment 28093 [details] PNG generated by rsvg utility
Created attachment 28094 [details] GIMP rendering of the SVG
s/doesn't gets/gets/ of course
I hate to look at that code again but it looks as if it indeed somehow wrong.
Had a look at our code and I think that librsvg is to blame. Since the SVG specifies the unit in points (72pt x 72pt) it should be scaled accordingly to the choosen resolution. But whatever resolution is used the graphics always ends up the same size. The best result is achieved when rendered with 96dpi. IIRC that's the default resolution used by librsvg and this is why the icon looks good when rendered with the rsvg utility. I might be interpreting this wrongly but I will nevertheless reassign this report to librsvg in the hope that someone from the rsvg developers can point out if and what the GIMP plug-in is doing wrong here.
I am using librsvg-2.6.4, btw. ( You might want to add some newer versions to the librsvg bugzilla module. The newest version to choose from is 2.5.x. )
RSVG has a call that you might be interested in: http://librsvg.sourceforge.net/docs/html/rsvg-core-api.html#RSVG-HANDLE-SET-DPI Inside of the Gimp plugin, you may wish to query the Gimp's DPI, and then tell RSVG to use that instead of its default resolution, which is 90. Reassigning to the Gimp, CC'ing myself.
We are using this function. What exactly are you suggesting that we change?
Reassigning to librsvg since I don't seem to be able to find what is wrong in the GIMP plug-in. Perhaps Dom can enlighten me.
I'll take a look at this. Question - what is the GIMP's DPI in this case? I'll compare that to rsvg's output using the command-line tool @ that DPI. Thanks.
The plug-in uses the DPI setting entered by the user. On first use, the dialog is initialized with a default resolution of 72.0 dpi.
accept bug
*** Bug 153463 has been marked as a duplicate of this bug. ***
Pinging for an update on this bug. Does it happen with the CVS (2.13.x) version of librsvg too?
*** Bug 345056 has been marked as a duplicate of this bug. ***
Bug still exists in 2.14.4 Will it ever be fixed?
It'll be fixed when it gets fixed.
attachment 28092 [details] works well librsvg-2.26.0.
Indeed, this doesn't seem to be an issue anymore.