Bug XY Coordinates

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
Morgano
Posts: 4
Joined: 2012-05-23T03:16:22-07:00
Authentication code: 13

Bug XY Coordinates

Post by Morgano »

Hello,

i try to convert this SVG: http://www.getshirts.de/upload/test_svg.svg

into: Image

The Result after conversion is
Image

The X and Y Value of the Inline SVG : <svg id="svg_motiv1" x="136" y="122" width="125" height="40" viewBox="0 0 16.3877 5.27807" > is set to zero
The width + height is ok.

Any suggestions - is there a workaround?

Greets Morgano
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug XY Coordinates

Post by anthony »

Check what SVG delegate method is being used!

http://www.imagemagick.org/Usage/draw/#svg
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Bug XY Coordinates

Post by fmw42 »

anthony wrote:Check what SVG delegate method is being used!

http://www.imagemagick.org/Usage/draw/#svg

I got even worse looking results using RSVG (no shirt showing at all).
Morgano
Posts: 4
Joined: 2012-05-23T03:16:22-07:00
Authentication code: 13

Re: Bug XY Coordinates

Post by Morgano »

Is here a global problem because the 2 svgs?

Code: Select all

<svg id="main_svg" width="400" height="400">
	<svg id="svg_motiv1" x="136" y="96" width="128" height="32" viewBox="0 0 57.0653 14.1677" >
	</svg>
</svg>
Greetings Morgano
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug XY Coordinates

Post by anthony »

I ran your test svg file with "rsvg_view" (direct use of the RSVG library withotu Imagemagick) and it only showed the shirt.
No "Thinking..." bar at all. -- though it was a little slow (vectored images will do that! SVG is not designed for raster images)

I get the same result with ImageMagick. Not surprising really.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Morgano
Posts: 4
Joined: 2012-05-23T03:16:22-07:00
Authentication code: 13

Re: Bug XY Coordinates

Post by Morgano »

Hello Anthony,

thanks for testing.

I did not have the problem with image and vector.
When you read the sourcecode of the svg - you see everything is in there. You see it correct in browser?

But i recognize that Imagemagick has a problem with two svgs nested / encapsulated.

Is this final that nested svgs cannot be rasterized?
We want to use imagemagick instead of Batik for Tomcat Server.

Thanks and greets Morgano
Morgano
Posts: 4
Joined: 2012-05-23T03:16:22-07:00
Authentication code: 13

Re: Bug XY Coordinates - Update

Post by Morgano »

Hello,

here a new and simplified description of the Bug without images:

This should be the result
Image

Instead the SVG rasterize this:
Image

The SVG:
http://www.getshirts.de/upload/im_test2_c.svg

The Problem is the same:
the x and y coordinates of the incapsulated svg is wrong and set to zero

Encapsulated SVG should raster correct:
http://svg.tutorial.aptico.de/start3.ph ... -Elementen

The Code:

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <rect x="0" y="0" width="200" height="200" style="fill:red;" />
  <svg x="10" y="10" width="100" height="100">
    <rect x="0" y="0" width="100" height="100" style="fill:blue;" />
  </svg>
</svg>
will not raster correct.

Have i explained the problem understandable?

Thanks for your help

Greetings from germany Morgano
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Bug XY Coordinates

Post by fmw42 »

With your im_test2_c.svg, on IM 6.7.7.3 Q16 Mac OSX Snow Leopard,

This works fine using RSVG:

convert im_test2_c.svg im_test2_c.png

This fails as you show using IM internal MSVG

convert MSVG:im_test2_c.svg im_test2_c2.png

I recommend you install RSVG and then you have the choice to use either, which ever works best.
Post Reply