Lost patternTransform during SVG conversion.

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
flyingfox
Posts: 2
Joined: 2011-09-01T13:55:16-07:00
Authentication code: 8675308

Lost patternTransform during SVG conversion.

Post by flyingfox »

I'm running into a bit of trouble when converting SVG files with defined patterns that have a rotated transform. The minimal test case is:

Code: Select all

?xml version="1.0" ?>
<!DOCTYPE svg 
  PUBLIC '-//W3C//DTD SVG 1.1//EN'
  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg height="200.0" version="1.1" width="200.0" xmlns="http://www.w3.org/2000/svg">
    <defs>
        <pattern height="9" id="test_hash" patternTransform="rotate(45) " patternUnits="userSpaceOnUse" width="9">
            <path d="M 5 0 V 9" stroke="black" stroke-width="1"/>
        </pattern>
    </defs>
    <polygon fill="url(#test_hash)" points="10 10, 10 100, 100 100, 100 10" stroke="black" stroke-width="1"/>
</svg>
I've tested this with Inkscape (a SVG editor) and evince (document viewer) and I get the a box with hashwd 45 degree lines. When I use convert (Version: ImageMagick 6.5.7-8 2010-12-02 Q16) under Ubuntu 10.04 LTS the 45 degree rotation in the pattern is lost. The result is a box filled with vertical lines. This is true no matter what output format is specified (png, jpg, and pdf tested).

The format info page states that libxml2 and Free Type 2 are required. Both are installed (libxml2 2.7.6, Free Type 2 2.3.11). I understand that SVG support is incomplete and I can work around this for right now.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Lost patternTransform during SVG conversion.

Post by fmw42 »

try installing the RSVG delegate and then IM again and see if that helps. Generally RSVG is more fully functional as I have been told.

You can see which you have installed by

convert -list format

and look at the commend by SVG
flyingfox
Posts: 2
Joined: 2011-09-01T13:55:16-07:00
Authentication code: 8675308

Re: Lost patternTransform during SVG conversion.

Post by flyingfox »

That did it. For some reason I didn't have librsvg2-dev installed (only the -bin package). When that was installed I grabbed the newest source version (6.7.2-1), ran configure with the --with-rsvg option then compiled and installed. Works smoothly now.
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: Lost patternTransform during SVG conversion.

Post by broucaries »

Any news of this ? We plan to move debian to internal svg engine

Another test case : https://bugs.launchpad.net/ubuntu/+sour ... bug/824876
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Lost patternTransform during SVG conversion.

Post by magick »

We do not recommend the internal SVG rendering engine. It does a good job with a majority of the SVG elements but is far from complete. Instead we recommend utilizing the RSVG delegate library.
Post Reply