• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Resizing of transparent/animated gifs [solved]

#12
[eluser]vigna[/eluser]
At first impression I thought I got it working by using #1313 but unfortunately it didn't for me.
I got two problems by keeping the if condition and by removing it ref: #1313 code
1. The resized image came with a black background OR
2. The resized image came in black and white color with transparent background.

Finally I used the below code found in php.net

Find Code:
Code:
$dst_img = $create($this->width, $this->height);

I inserted the below code after the above line as specified by #1313
Code:
$transparencyIndex = imagecolortransparent($src_img);
$transparencyColor = array('red' => 255, 'green' => 255, 'blue' => 255);

if ($transparencyIndex >= 0) {
    $transparencyColor    = imagecolorsforindex($src_img, $transparencyIndex);  
}

$transparencyIndex    = imagecolorallocate($dst_img, $transparencyColor['red'], $transparencyColor['green'], $transparencyColor['blue']);
imagefill($dst_img, 0, 0, $transparencyIndex);
imagecolortransparent($dst_img, $transparencyIndex);


Messages In This Thread
Resizing of transparent/animated gifs [solved] - by El Forum - 10-17-2007, 07:02 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 10-17-2007, 07:15 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 10-17-2007, 07:18 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 10-17-2007, 08:11 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 10-23-2007, 04:55 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 11-15-2007, 04:57 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 04-07-2008, 04:41 PM
Resizing of transparent/animated gifs [solved] - by El Forum - 08-23-2009, 12:09 PM
Resizing of transparent/animated gifs [solved] - by El Forum - 09-15-2009, 05:28 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 09-15-2009, 07:01 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 09-15-2009, 07:21 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 09-19-2009, 07:18 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 04-17-2010, 09:49 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 07-15-2010, 08:41 PM
Resizing of transparent/animated gifs [solved] - by El Forum - 11-25-2010, 05:21 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 12-24-2010, 02:47 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 01-27-2011, 08:44 PM
Resizing of transparent/animated gifs [solved] - by El Forum - 06-08-2011, 10:02 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 07-20-2011, 06:58 AM
Resizing of transparent/animated gifs [solved] - by El Forum - 07-21-2011, 12:54 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.