Annotate not honoring default gravity with IM7
Posted: 2016-04-07T07:27:00-07:00
Using "ImageMagick-7.0.0-0~beta20160329-Q16-HDRI-x64-static.exe" on Windows 7 64, there seems to be some odd behavior of "annotate" and "draw text" when no gravity setting is specified. These commands...
... result in the "abc123" being placed almost entirely outside the canvas at the left top. And this command...
... should result in "abc123" oriented to the upper left corner by the "label" operation with a best-fit pointsize, then use that pointsize to place a green copy of "abc123" over the label but offset by +2+2. The green one ends up outside the canvas just barely visible at the left top.
Specifying a gravity setting seems to resolve the problem, even if it's the default of "northwest". This works...
This doesn't...
I would think the "annotate" and "draw text" operations should honor the default gravity setting of northwest, either when gravity is not specified or after returning it to the default with "+gravity", but it's placing those pieces of text outside the canvas instead.
Code: Select all
magick ^
-size 600x100 ^
canvas:white ^
-pointsize 48 ^
-draw "text 0,0 'abc123'" ^
testing1.png
magick ^
-size 600x100 ^
canvas:white ^
-pointsize 48 ^
-annotate +0+0 "abc123" ^
testing2.png
Code: Select all
magick ^
-size 600x100 ^
label:"abc123" ^
-pointsize %[label:pointsize] ^
-fill green ^
-annotate +2+2 "abc123" ^
testing3.png
Specifying a gravity setting seems to resolve the problem, even if it's the default of "northwest". This works...
Code: Select all
magick ^
-size 600x100 ^
canvas:white ^
-pointsize 48 ^
-gravity northwest ^
-draw "text 0,0 'abc123'" ^
testing4.png
Code: Select all
magick ^
-size 600x100 ^
canvas:white ^
-pointsize 48 ^
-gravity center ^
-draw "text 0,0 'abc123'" ^
+gravity ^
-draw "text 0,0 'def456'" ^
testing5.png