possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX

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

possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX

Post by fmw42 »

Overlaying a strokewidth=0 on a strokewidth=20 is properly centered vertically but not horizontally. It is off by half the strokewidth.

Is this a bug?

# get optimal size
size=`convert -background none -font Tahoma -fill red -pointsize 100 -stroke red -strokewidth 20 label:"Test text" -format "%wx%h" info:`

# This fails to center properly horizontally
convert -size $size xc:none \
-gravity center -font Tahoma -fill red -pointsize 100 -stroke red -strokewidth 20 -annotate +0+0 "Test text" \
-gravity center -font Tahoma -fill white -pointsize 100 -stroke white -strokewidth 0 -annotate +0+0 "Test text" result1.png

Image


convert -size $size xc:none \
-gravity center -font Tahoma -fill red -pointsize 100 -stroke red -strokewidth 20 -annotate +0+0 "Test text" \
-gravity center -font Tahoma -fill white -pointsize 100 -stroke white -strokewidth 0 -annotate -10+0 "Test text" result2.png

Image
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX

Post by dlemstra »

This does look like a bug to me. When you make the background xc:green instead of xc:none you will notice that the red text is not centered. I think the text should be centered. Maybe magick can tell us if this is by design?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX

Post by fmw42 »

This issue does not seem to have been resolved yet in 6.9.1.3 beta. As far as I can tell, it still has an offset.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX

Post by fmw42 »

This issue does not seem to have been resolved in recently released 6.9.1.3. As far as I can tell, it still has an offset.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.9.1-4 Beta, available by sometime tomorrow. Thanks.
Post Reply