http://studio.imagemagick.org/pipermail/magick-users/2005-February/014825.html
I have two images - one, a photo, and two, a (smaller, ribbon-sized)
copyright notice. In ImageMagick I used composite; I'm trying PHP's
MagickCompositeImage and none of it seems to work (is there any way to
get this program to be verbose about errors??)
Here is the gist of it:
# File exists
$oldimlocation = "/home/site.com/image.jpg";
# File to be created
$imdirlocation = "/home/site.com/imagecopyright.jpg";
$fsized = NewMagickWand();
$overlay = NewMagickWand();
$workwand = NewMagickWand();
# Copyright graphic
$copyrightimg = "/home/site.com/htdocs/newcopyright.jpg";
$fulls = MagickReadImage($fsized,$oldimlocation);
$crigh = MagickReadImage($overlay,$copyrightimg);
$wid = MagickGetImageWidth($fsized);
$hei = MagickGetImageHeight($fsized);
$proportion = $hei / $wid; $outwid = 1280; $outhei = (1280 *
$proportion);
$oimg = MagickScaleImage($fsized,$outwid,$outhei);
$outimg =
MagickCompositeImage($workwand,$fsized,MW_OverCompositeOp,0,0);
$outimgB =
MagickCompositeImage($workwand,$overlay,MW_OverCompositeOp,0,0);
$outf = MagickWriteImage($workwand,$imdirlocation);
The two lines that do not work are the MagickCompositeImage lines - I
have tried other composite operators, even tried (as the manpage
suggests it might need) using a zero since it says integer. It just
stops without compositing anything.
-doug