Here are some changes I made to support GIF transparencies. I also changed the imagecopyresized function to imagecopyresampled because the quality of the shrunk images was fairly poor. This fixed it right up.
// Create new image
if($function == \'ImageCreateFromGif\')
{
$colorTransparent = imagecolortransparent($source_img);
$new_img = imagecreate($neww,$newh);
imagepalettecopy($new_img,$source_img);
imagefill($new_img,0,0,$colorTransparent);
imagecolortransparent($new_img, $colorTransparent);
}
else
{
$new_img = imagecreatetruecolor($neww,$newh);
}
// Copy and resize image
imagecopyresampled($new_img,$source_img,0,0,0,0,$neww,$newh,$size[0],$size[1]);