note 103094 deleted from function.imagecopymerge by danbrown

From: Date: Fri, 25 Mar 2011 12:07:43 +0000
Subject: note 103094 deleted from function.imagecopymerge by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-178198@lists.php.net to get a copy of this message
Note Submitter: mristila gmail com ---- I tried to do simple crossfading with this function but it is not working as intended. The code is here: <?php $from = imagecreatefromjpeg("journal-1.jpg"); $to = imagecreatefromjpeg("publications-1.jpg"); $intermediary = imagecreatetruecolor(imagesx($to), imagesy($to)); echo "\n"; for($i = 0; $i <= 100; $i++) { $intermediary = $to; imagecopymerge($intermediary, $from, 0, 0, 0, 0, imagesx($from), imagesy($from), $i); imagejpeg($intermediary, "output-$i.jpg"); echo "wrote output-$i.jpg\n"; } echo "\nall done!\n\n"; @imagedestroy($from); @imagedestroy($to); @imagedestroy($intermediary); ?> But what happens is that the crossfading is all done when i reaches about 35. The rest 65 images are just the target. This is a bug that you need to take into account. Workarounds are appreciated!

« previous php.notes (#178198) next »