Page 1 of 1

possible bug annotate default gravity

Posted: 2019-12-05T11:20:19-07:00
by fmw42
IM 6.9.10.77 and IM 7.0.9.7 Q16 Mac OSX.

It would appear that the default gravity of northwest is not being used. The result is offset the wrong direction if one does not specify -gravity before -annotate.

Wrong without -gravity: (NOTE the word "TESTING" is off the image)

Code: Select all

convert logo: -font arial -pointsize 36 -fill black -annotate +20+20 "TESTING" logo_text6a.png
Image

Correct with -gravity:

Code: Select all

convert logo: -font arial -pointsize 36 -fill black -gravity northwest -annotate +20+20 "TESTING" logo_text6b.png
Image

Re: possible bug annotate default geometry

Posted: 2019-12-05T11:56:56-07:00
by snibgo
I think you mean "-gravity", not "-geometry".

Default "-gravity" is "none", which is not the same as "NorthWest".

Re: possible bug annotate default geometry

Posted: 2019-12-05T15:00:13-07:00
by fmw42
Yes, -gravity. Mental typo! Fixed, now.

Re: possible bug annotate default gravity

Posted: 2019-12-09T13:44:00-07:00
by fmw42
This still seems to be an issue in IM 6.9.10.78 and IM 7.0.9.8 Q16 Mac OSX.

Re: possible bug annotate default gravity

Posted: 2019-12-09T18:43:56-07:00
by magick
For -annotate +20+20, the offset is +20+20 for an undefined gravity. Whereas, for Northwest, the offset is positioned relative to the font metrics and height. Its possible that in older versions of ImageMagick, undefined & Northwest were equivalent.

Re: possible bug annotate default gravity

Posted: 2019-12-09T20:03:15-07:00
by fmw42
But in the the case now with +20+20 and undefined it looks like the offset is actually +20-20! That is the Y offset is negative -- off the image. See my example above.

Re: possible bug annotate default gravity

Posted: 2019-12-09T20:24:43-07:00
by snibgo
The bottom-left of the T glyph is at about +20+20.

Re: possible bug annotate default gravity

Posted: 2019-12-09T22:22:53-07:00
by fmw42
Is the offset measured at the bottom left? That could be my misunderstanding.