Page 1 of 1

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

Posted: 2016-11-19T13:03:45-07:00
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

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

Posted: 2016-11-19T13:42:44-07:00
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

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

Posted: 2016-11-19T14:11:20-07:00
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.

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

Posted: 2016-11-19T14:39:31-07:00
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.

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

Posted: 2016-11-19T15:12:43-07:00
by fmw42
Thanks Glenn. Good point.

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

Posted: 2016-11-20T12:19:35-07:00
by glennrp
Verified that this morning's 7.0.3-8 beta works properly.