Welcome to WebmasterWorld Guest from 54.197.171.28

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Resizing Gif Problems

transparency goes black, animation lost

   
5:08 pm on Apr 5, 2007 (gmt 0)

10+ Year Member



I have a script that is resizing gif images. There is a problem if the gif has a trasparent background, the background turns black. Also any animation in the gif is lost. Any suggestions? This is a portion of the code:

$thumb=imagecreatetruecolor($w1,$h1);
$new=imagecreatefromgif($imagepath);
for($i=0;$i<256;$i++) imagecolorallocate($thumb,$i,$i,$i);
imagecopyresampled($thumb,$new,0,0,0,0,$w1,$h1,$w0,$h0);
imagejpeg($thumb,$thumbpath);
ImageDestroy($new);
ImageDestroy($thumb);

8:31 pm on Apr 5, 2007 (gmt 0)

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Read HERE [webmasterworld.com]