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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
garyvdm
Posts: 2
Joined: 2011-02-07T07:21:33-07:00
Authentication code: 8675308

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

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

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

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
garyvdm
Posts: 2
Joined: 2011-02-07T07:21:33-07:00
Authentication code: 8675308

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

Post 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...
Post Reply