In PHP code, given an .png image path, I need to detect the bit-depth of that image. How can I do that?
I've tried to use getImageSize() and read the bits
as below sample code but it always returns '8' for 24-bits/32-bits image.
Please help.
class Utils {
//Ham de lay bits cua image
public static function getBits($image) {
$info = getImageSize($image);
return $info['bits'];
}
}