[eluser]Grasp Minds[/eluser]
Thank you for the codes but still have a problem in resizing for some gif images. After resizing, image background is green.
So I found another solution from php.net and its working fine!
Code:
//Start code- For transparency//
$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);
//End code- For transparency//
Please put the above code after the following line
Code:
$dst_img = $create($this->width, $this->height);