Gif images with transparent backgrounds end up having black backgrounds and animated gif images turn black completely. Any ideas why?


$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromgif($filePath);
imagealphablending($image_p,true);
imagesavealpha($image_p,true);
$transparent = imagecolorallocatealpha($image_p,0,0,0,127);
imagefill($image_p,0,0, $transparent);
imagecopyresampled($image_p, $filePath,0,0,0,0, $width, $height,
$width_orig, $height_orig);... Code (markup):

Transparent gif images show black background when resized