Page 1 of 1

svg: Gradient offset wrong when using transform="rotate...

Posted: 2011-02-07T07:37:35-07:00
by garyvdm
Hi

If you have a svg file with a with a element that uses a gradient, and it has a rotate transform, then the offset of the gradient.

Minimal test case: http://pastebin.com/XmqP7U7N
ImageMagick: http://imagebin.org/136587
Firefox: http://imagebin.org/136586

My use case is this file: http://en.wikipedia.org/wiki/File:Rowin ... mplate.svg, and the many files based on it. Sometimes they are rendered correctly, e.g.: http://en.wikipedia.org/wiki/File:Josep ... _Blade.svg, but if I download them, and run convert manually on my computer, then they are allways wrong. So I think that was not a bug in some version of imagemagick in the past, and they are showing a cached version.

Gary

Re: svg: Gradient offset wrong when using transform="rotate.

Posted: 2011-02-07T18:09:39-07:00
by anthony
Gradients have always been a problem in the builtin SVG handler.

However if you install RSVG (you may need to rebuild IM with a --with-rsvg option)
then it will use the RSVG library to render SVG to a raster image.
Or you can use RSVG directly without using IM.

You must remember IM is primarily a Raster Image Processor. It really has minimal understanding of Vector images.

See, A word about Vector Image formats
http://www.imagemagick.org/Usage/formats/#vector

Re: svg: Gradient offset wrong when using transform="rotate.

Posted: 2011-02-08T04:09:28-07:00
by garyvdm
Thanks for the info.

I tried with rsvg-convert, and it had the same bug, so I've opened https://bugzilla.gnome.org/show_bug.cgi?id=641823.

I discovered that WIkipedia uses rsvg to rastorize svg anyway, and not imagemagick as I thought...