Page 1 of 1

[Resolved]possible bug annotate with negative rotations

Posted: 2018-10-19T12:19:30-07:00
by fmw42
IM 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.

Re: possible bug annotate with negative rotations

Posted: 2018-12-28T13:45:43-07:00
by fmw42
In IM 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.

Re: possible bug annotate with negative rotations

Posted: 2018-12-29T06:19:38-07:00
by magick
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ later today. The patch will be available in the beta releases of ImageMagick @ by sometime tomorrow.

Re: possible bug annotate with negative rotations

Posted: 2018-12-29T17:21:25-07:00
by fmw42
Thanks. This seems to be fixed in IM beta and IM beta.

Re: [Resolved]possible bug annotate with negative rotations

Posted: 2019-11-30T17:02:37-07:00
by user001
I noticed this regression (and then stumbled upon this thread) after a recent upgrade from v6.9.7-4 to v6.9.10-23. fmw42 mentioned that it is fixed in 6.9.10-22 beta, so I assumed it would also be fixed in 6.9.10-23 (a later version; this also happens to be the IM version available in the package repository for all current versions of Debian). What is the earliest release of 6.9.10 in which this bug is fixed?

Command to reproduce the problem:

$ convert --version
Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101
Copyright: © 1999-2019 ImageMagick Studio LLC
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib
$ convert 'xc:white[100x100!]' -gravity center -fill black -pointsize 36 -annotate "-50+5" "test" x: