Thanks for the reply. That wasn't what I wanted to hear, but it was what I expected. I ended up hacking together a crude function cobbled together from some notes posted on php.net. It seems to work OK.
function isTransparent($gif) {
$img_error = false;
list($width, $height, $type) = getimagesize($gif);
$src = @imagecreatefromgif($gif);
if (!$src) return false;
// resource handle for source image now in $src
// Now calculate scaling factor and put in $sf
if($width >= $height && $width > 100) $sf = $width / 100;
elseif($height > 100) $sf = $height / 100;
else $sf = 1;
$newwidth = intval($width / $sf);
$newheight = intval($height / $sf);
$tpcolor = imagecolorat($src, 0, 0);
// in the real world, you'd better test all four corners, not just one!
$dest = imagecreate($newwidth, $newheight);
// $dest automatically has a black fill...
imagepalettecopy($dest, $src);
imagecopyresized($dest, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
$pixel_over_black = imagecolorat($dest, 0, 0);
// ...but now make the fill white...
$bg = imagecolorallocate($dest, 255, 255, 255);
imagefilledrectangle($dest, 0, 0, $newwidth, $newheight, $bg);
imagecopyresized($dest, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
$pixel_over_white = imagecolorat($dest, 0, 0);
// ...to test if transparency causes the fill color to show through:
if($pixel_over_black != $pixel_over_white) {
// Background IS transparent
return true;
}
else { // Background (most probably) NOT transparent
return false;
}
imagedestroy($src);
imagedestroy($dest);
}