I'm using a crop & resize function for images, but I need to let it crop/resize ONLY png files WITH transparent backgrounds, at least 1 pixel in the image should be transparent for the image to be accepted.
Is possible to check if a PNG image has transparent background/pixels?
I'm using PHP and GD libraries.
EDIT: Ok, I've figured out how to do this on PHP with GD libraries. Look how clean it looks! :)
<?php
$im = imagecreatefrompng("php.png");
$rgba = imagecolorat($im,1,1);
$alpha = ($rgba & 0x7F000000) >> 24;
var_dump($alpha);
?>
Any ideas how to do an array for the x/y coordenates to check all the image pixels looking for at least 1 pixel = $alpha = 127?