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