0

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);
Community
  • 1
  • 1
Deniz Zoeteman
  • 9,691
  • 26
  • 70
  • 97
  • Possible duplicate of [How to check if an image has transparency using GD?](http://stackoverflow.com/questions/5495275/how-to-check-if-an-image-has-transparency-using-gd) You can use the code created there to check the source image for transparent pixels in the area to copy. – Charles Apr 03 '11 at 14:37
  • Duplicate of http://stackoverflow.com/questions/5495275/how-to-check-if-an-image-has-transparency-using-gd – Alexander Gessler Apr 03 '11 at 14:38

0 Answers0