Page 1 of 1

What is the error in this code? Magickmontageimage

Posted: 2009-04-20T05:52:01-07:00
by ncm123

Code: Select all

<?php
$r = NewMagickWand();

MagickReadImage($r, "1.jpg");
      MagickReadImage($r, "2.jpg");
      MagickReadImage($r, "3.jpg");
      MagickReadImage($r, "4.jpg");

$dwand = NewDrawingWand();

if( MagickMontageImage( $r, $dwand,"6x4+0+0","120x120+4+3", MW_ConcatenateMode,"0x0+0+0") )
{
header('Content-Type: image/jpeg');
  MagickEchoImageBlob( $r );
}
else
{
  echo MagickGetExceptionString($r);
}

?>
It is not displaying any errors just displays a cross icon in Internet explorer. Can someone help!

Thanks

Re: What is the error in this code? Magickmontageimage

Posted: 2009-04-20T06:11:24-07:00
by magick
MagickMontageImage() returns a new wand. You want something like:

Code: Select all

if( $t = MagickMontageImage( $r, $dwand,"6x4+0+0","120x120+4+3", MW_ConcatenateMode,"0x0+0+0") )
{
header('Content-Type: image/jpeg');
  MagickEchoImageBlob( $t );
}
else
{
  echo MagickGetExceptionString($r);
}