homepage Welcome to WebmasterWorld Guest from 54.161.166.171
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Resizing Gif Problems
transparency goes black, animation lost
matthewamzn




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

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);

 

henry0




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

Read HERE [webmasterworld.com]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved