[Resolved]possible bug annotate with negative rotations

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

[Resolved]possible bug annotate with negative rotations

Post by fmw42 » 2018-10-19T12:19:30-07:00

IM 6.9.10.12 Q16 Mac OSX Sierra

I tried using negative values for the rotation in -annnotate. It did the rotation but the text was offset badly.

-annotate -10x-10+${xoff}+"${off}

However, converting to positive rotations works fine as

-annotate 350x350+${xoff}+"${off}

Compare these two results:

Code: Select all

convert logo: -fill red -pointsize 64 -font arial -annotate 350x350+320+240 'testing' test1.jpg

Code: Select all

convert logo: -fill red -pointsize 64 -font arial -annotate -10x-10+320+240 'testing' test2.jpg

If this is not a bug, then the documentation for -annotate should be modified to say that negative rotations are not allowed.

The documentation says:
Using -annotate degrees or -annotate degreesxdegrees produces an unsheared rotation of the text. The direction of the rotation is positive, which means a clockwise rotation if degrees is positive. (This conforms to the usual mathematical convention once it is realized that the positive y–direction is conventionally considered to be downward for images.)
But it is not really clear if that means only positive values are allowed.

User avatar
fmw42
Posts: 25262
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug annotate with negative rotations

Post by fmw42 » 2018-12-28T13:45:43-07:00

In IM 6.9.10.20 Mac OSX Sierra, the first command above is working fine. But the second command, thought rotating properly now, is not offset properly. So there is still a bug here. The two commands should give exactly the same results and they do not.

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

Re: possible bug annotate with negative rotations

Post by magick » 2018-12-29T06:19:38-07:00

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

User avatar
fmw42
Posts: 25262
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug annotate with negative rotations

Post by fmw42 » 2018-12-29T17:21:25-07:00

Thanks. This seems to be fixed in IM 6.9.10.22 beta and IM 7.0.8.22 beta.

Post Reply