Incorrect conversion from MVG to SVG

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
rmagick
Posts: 245
Joined: 2006-03-16T17:30:48-07:00
Location: Durham, NC, USA

Incorrect conversion from MVG to SVG

Post by rmagick »

This is 6.4.9-8 on Ubuntu 8.10, built with librsvg.

I started with the MVG program shown below, which produces the image below it, to SVG using this command:

convert -size 300x300 pattern.mvg pattern.svg

Code: Select all

push defs
push pattern xxxxx 0 0 16 16
push graphic-context
stroke "none"
fill "DarkBlue"
rectangle 0,0 16,16
fill "yellow"
stroke "red"
polygon 0,0,8,16,16,0,0,0
pop graphic-context
pop pattern
pop defs
fill "xxxxx"
stroke "blue"
stroke-width 5
path 'M50,50 Q-30,100 50,150 100,230 150,150 230,100 150,50 100,-30 50,50'

Image

However, the resulting SVG file is incorrect, producing the image below:

Code: Select all

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="300" height="300">
<defs>
<pattern id="xxxxx" x="0" y="0" width="16" height="16">
<g style="stroke:none;fill:DarkBlue;">
  <rect x="0" y="0" width="16" height="16"/>
fill:yellow;stroke:red;  <polygon points="0,0 8,16 16,0 0,0 0,0 "/>
</g>
</pattern>
</defs>
fill:xxxxx;stroke:blue;stroke-width:5;  <path d="M50,50 Q-30,100 50,150 100,230 150,150 230,100 150,50 100,-30 50,50"/>
</svg>
Image

Please let me know if you need any other information.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Incorrect conversion from MVG to SVG

Post by anthony »

Even the rsvg library does not produce a good result from that SVG, so something is definitely wrong with the SVG generated.

Unfortunately I can help you with SVG :-(
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply