Page 1 of 1

How to Create Multiple images in a TIF image

Posted: 2009-04-07T08:45:35-07:00
by gzabriskie
I am trying to create multiple images in a tif image, but am not having any luck, listed below is some sample code that I have experimented with.

Code: Select all

<?php
$temp1 = new Imagick('img3.tif');
$temp2 = new Imagick('img2.tif');
$temp3 = new Imagick('img1.tif');

$newimg = new Imagick('temp.tif');
$newimg-> addImage($temp1);
$newimg-> addImage($temp2);
$newimg-> addImage($temp3);

$newimg-> writeImage('temp.tif');
$newimg-> clear();
$newimg-> destroy();
?>
All that I get is the last image added to the object, which in this case would be the img1.tif.

Can someone give me some insight or direct me to an example that will work. Any help is greatly appreciated.

Re: How to Create Multiple images in a TIF image

Posted: 2009-04-07T18:32:30-07:00
by el_supremo
I think you should use writeImages. See http://ca.php.net/manual/en/function.im ... images.php
You'll need to use a boolean value of true for the second argument.

Pete

Re: How to Create Multiple images in a TIF image

Posted: 2009-04-08T06:54:39-07:00
by gzabriskie
Yes, you are correct, Thanks for the response.