What is the error in this code? Magickmontageimage

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
ncm123

What is the error in this code? Magickmontageimage

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: What is the error in this code? Magickmontageimage

Post 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);
}
Post Reply