possible bug annotate default gravity

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

possible bug annotate default gravity

Post 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

snibgo
Posts: 12910
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: possible bug annotate default geometry

Post by snibgo »

I think you mean "-gravity", not "-geometry".

Default "-gravity" is "none", which is not the same as "NorthWest".
snibgo's IM pages: im.snibgo.com

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

Re: possible bug annotate default geometry

Post by fmw42 »

Yes, -gravity. Mental typo! Fixed, now.

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

Re: possible bug annotate default gravity

Post by fmw42 »

This still seems to be an issue in IM 6.9.10.78 and IM 7.0.9.8 Q16 Mac OSX.

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

Re: possible bug annotate default gravity

Post 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.

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

Re: possible bug annotate default gravity

Post 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.

snibgo
Posts: 12910
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: possible bug annotate default gravity

Post by snibgo »

The bottom-left of the T glyph is at about +20+20.
snibgo's IM pages: im.snibgo.com

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

Re: possible bug annotate default gravity

Post by fmw42 »

Is the offset measured at the bottom left? That could be my misunderstanding.

Post Reply