[RESOLVED] IM7 "-draw image over ..." fails, IM6 succeeds

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
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

[RESOLVED] IM7 "-draw image over ..." fails, IM6 succeeds

Post by glennrp »

The following code produces the expected result, with white text on a green canvas:

Code: Select all

  M=im6.9.6-5q16convert    # works, produces white text on green canvas
# M=im7.0.3-7q16magick     # fails, produces no text on green canvas
V=`$M -version | sed -e "s/Version: //;s/\(.*Q[^ ]*\)*.*/\1/;1q"`
# White text on transparent black:
   NONE=\#0000
   $M xc:$NONE[512x128!] -pointsize 24 -fill white \
   -gravity center -draw "text 0,0 '$V'" png32:text.png
# Opaque green canvas:
   $M xc:green[512x128!] green.ppm
# Overlay the white text on the green canvas:
   $M green.ppm -draw "image SrcOver 0,0 0,0 text.png" x:
echo $V
Image

but if I comment out the first line and enable the second line, to run IM7 instead of IM6,
all I see is the green canvas.

Observed on Ubuntu 16:04 LTS, ImageMagick-7.0.3-7 Q16
Last edited by glennrp on 2016-11-20T12:20:58-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM7 "-draw image over ..." fails, IM6 succeeds

Post by fmw42 »

I can confirm on my Mac OSX snow leopard with the specified versions below and simplifying the commands

This works:

Code: Select all

version="Imagemagick 6.9.6.5 Q16"
convert xc:none[512x128\!] -pointsize 24 -fill white -gravity center -draw "text 0,0 '$version'" png32:text.png
convert xc:green[512x128\!] green.ppm
convert green.ppm -draw "image SrcOver 0,0 0,0 text.png" tmp6.png
This fails with no text on the green image:

Code: Select all

version="Imagemagick 7.0.3.7 Q16"
magick xc:none[512x128\!] -pointsize 24 -fill white -gravity center -draw "text 0,0 '$version'" png32:text.png
magick xc:green[512x128\!] green.ppm
magick green.ppm -draw "image SrcOver 0,0 0,0 text.png" tmp7.png
I even tried adding -alpha on -channel rgba:

Code: Select all

magick xc:none[512x128\!] -pointsize 24 -fill white -gravity center -draw "text 0,0 '$version'" png32:text.png
magick xc:green[512x128\!] green.ppm
magick green.ppm -alpha on -channel rgba -draw "image SrcOver 0,0 0,0 text.png" tmp7.png
"magick convert" also fails
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM7 "-draw image over ..." fails, IM6 succeeds

Post by magick »

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: IM7 "-draw image over ..." fails, IM6 succeeds

Post by glennrp »

Thanks. Note, fmw, I had also tried using text.gif instead of text.png just to make sure the problem didn't lie in the PNG codec.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM7 "-draw image over ..." fails, IM6 succeeds

Post by fmw42 »

Thanks Glenn. Good point.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

[RESOLVED] Re: IM7 "-draw image over ..." fails, IM6 succeeds

Post by glennrp »

Verified that this morning's 7.0.3-8 beta works properly.
Post Reply