note 103094 added to function.imagecopymerge

From: Date: Fri, 25 Mar 2011 09:29:49 +0000
Subject: note 103094 added to function.imagecopymerge
Groups: php.notes 
Request: Send a blank email to php-notes+get-178195@lists.php.net to get a copy of this message
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! ---- Server IP: 62.237.7.3 Probable Submitter: 130.234.79.210 ---- Manual Page -- http://www.php.net/manual/en/function.imagecopymerge.php Edit -- https://master.php.net/note/edit/103094 Del: integrated -- https://master.php.net/note/delete/103094/integrated Del: useless -- https://master.php.net/note/delete/103094/useless Del: bad code -- https://master.php.net/note/delete/103094/bad+code Del: spam -- https://master.php.net/note/delete/103094/spam Del: non-english -- https://master.php.net/note/delete/103094/non-english Del: in docs -- https://master.php.net/note/delete/103094/in+docs Del: other reasons-- https://master.php.net/note/delete/103094 Reject -- https://master.php.net/note/reject/103094 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#178195) next »