SVG, applying transform="rotate()" and conversion issues

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
penciledin

SVG, applying transform="rotate()" and conversion issues

Post by penciledin »

So, I created several ellipses on top of each other, and the svg looks great, you can see it here:
http://www.deliciousbanner.com/imageMag ... es/167.svg

But the png ImageMagick rendered moved the rotated elements way off of where the svg shows it. You can see the png here:
http://www.deliciousbanner.com/imageMag ... es/167.png

And here's the code:

Code: Select all

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="150px" height="150px" version="1.1"
xmlns="http://www.w3.org/2000/svg">

<ellipse cx="75" cy="75" rx="60" ry="20" 
fill="rgb(0,255,0)" fill-opacity="1" 
stroke-width="5" stroke="rgb(0,200,0)" stroke-opacity="1" />

<ellipse cx="75" cy="75" rx="20" ry="60"
fill="rgb(0,0,255)" fill-opacity="0.5" 
stroke-width="5" stroke="rgb(0,200,0)" stroke-opacity="0.5" />

<ellipse cx="75" cy="75" rx="20" ry="60"
fill="rgb(255,0,255)" fill-opacity="0.5" 
stroke-width="5" stroke="rgb(0,200,0)" stroke-opacity="0.5" 
transform="rotate(45 75 75)" />

<ellipse cx="75" cy="75" rx="20" ry="60"
fill="rgb(255,0,255)" fill-opacity="0.5" 
stroke-width="5" stroke="rgb(0,200,0)" stroke-opacity="0.5" 
transform="rotate(-45 75 75)" />

</svg>
I'm imagining I've hit some problem with my transform="rotate()" function. Can anybody help me resolve this? You'd get major kudos in my book.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: SVG, applying transform="rotate()" and conversion issues

Post by magick »

You have discovered a bug. We will attempt to fix this problem in ImageMagick 6.3.3-1 Beta within the next week or so. Thanks for the problem report.
penciledin

Re: SVG, applying transform="rotate()" and conversion issues

Post by penciledin »

Thanks so much for your quick response! I'm eagerly awaiting the next release!
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: SVG, applying transform="rotate()" and conversion issues

Post by tsdineen »

Has this been resolved, yet? I have tested 6.3.3-4 and 6.3.4-10, and while the Changelog says it is supported, I can't seem to display the test svg properly on linux. It appears to be stripping the x and y off and only performing the rotate.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: SVG, applying transform="rotate()" and conversion issues

Post by anthony »

I tryed this with the latest, and get the svg my firefox browser displayed.

convert 167.svg miff:- | display -

Also tryied this without the RSVG library, my IM is compiled to use...

convert MSVG:167.svg miff:- | display -

In both cases the ellipses were nicely centered.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply