possible bug -draw with translate IM 6.6.6.1

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug -draw with translate IM 6.6.6.1

Post by fmw42 »

IM 6.6.6.1 Q16 (hdri) Mac OSX Tiger

The translate in -draw does not seem to be honoring the x coordinate. I believe this is causing my pagecurl script to fail as reported by Anthony.


convert -size 256x256 xc:white \
-fill red -draw "translate 86,172 rotate 31 ellipse 0,0 41,41 0,360" ellipse_test.png

Image
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug -draw with translate IM 6.6.6.1

Post by magick »

We can reproduce the problem you posted and will have a patch in ImageMagick 6.6.6-2 available by sometime tomorrow. Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug -draw with translate IM 6.6.6.1

Post by anthony »

As a FYI the problem was not the X coordinate, but the order of affine matrix multiplications internally in Draw when it merged the translate and the rotation of the drawing coodinates.

The correct result was obtained using..

Code: Select all

convert -size 256x256 xc:white -fill red -draw "rotate 31 translate 86,172 ellipse 0,0 41,21 0,360" show:
However that is only because the order was swapped, which is WRONG. The above ordering is not the correct solution, as you should translate origin before rotating the image around that new origin.

Thanks to Fred for tracking down the bug in 'pagecurl', and thanks to Cristy for fixing it.
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: possible bug -draw with translate IM 6.6.6.1

Post by fmw42 »

Thanks. Seems to be working correctly now in IM 6.6.6.2.

Note the changelog shows 6.6.6.1 (but I believe it was not working then).
Post Reply