Possible Duplicate:
How to check if an image has transparency using GD?
How can I find out if a certain image has transparency? I currently use the following code to extract a certain image inside an image, with GD in PHP. Somewhere here i need to find out if the $destp
has transparency, if so, do not display $destp
:
$srcp = imagecreatefrompng("test.png");
$destp = imagecreate(150, 150);
imagecopyresampled($destp, $srcp, 0, 0, 40, 8, 150, 150, 8, 8);
header('Content-type: image/png');
imagepng($destp);