How to Create Multiple images in a TIF image

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
gzabriskie

How to Create Multiple images in a TIF image

Post 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.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: How to Create Multiple images in a TIF image

Post 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
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
gzabriskie

Re: How to Create Multiple images in a TIF image

Post by gzabriskie »

Yes, you are correct, Thanks for the response.
Post Reply