I use the following code within my image class to handle the transparency of gifs however the problem I am having is that the Transparent Index Colour is black. Which is fine until you try to upload an image with black in it.
Is there any way of getting the actual transparent index and using that rather than it putting holes in my gifs?
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
//get image source data
$source = imagecreatefromgif($this->image);
//Get the images transparent color
$transparentIndex = imagecolortransparent($this->image);
$transparentColor = imagecolorsforindex($source, $transparentIndex);
// Apply the same color on the new image
$transparentIndex = imagecolorallocate($thumb, $transparentColor['red'], $transparentColor['green'], $transparentColor['blue']);
//Fill the background image with the Transparant color
imagefill($thumb, 0, 0, $transparentIndex);
//Set the background colour for the new image
imagecolortransparent($thumb, $transparentIndex);
// Restore transparency blending
imagesavealpha($thumb, true);