[eluser]Unknown[/eluser]
This worked for me:
Code:
// keep transparency
$transparent_index = imagecolortransparent($src_img);
if ($transparent_index >= 0)
{
imagepalettecopy($src_img, $dst_img);
imagefill($dst_img, 0, 0, $transparent_index);
imagecolortransparent($dst_img, $transparent_index);
imagetruecolortopalette($dst_img, true, 256);
}
elseif ($this->image_type == 3)
{
imagealphablending($dst_img, false);
$transparent_index = imagecolorallocatealpha($src_img, 0, 0, 0, 127);
imagefill($dst_img, 0, 0, $transparent_index);
imagesavealpha($dst_img, true);
}
Hope it helps.
- Landon