I am trying to distinguish PNG-8 and PNG-24 images with getimagesize
or Imagick, but I don't quite know how to to it.
getimagesize
does not return channels for my PNGs and displays the mimetype instead. It works well for other images and shows the correct values, but for PNG it just shows nothing.
edit: Imagick is not installed in my environment but gdlib is...
Can anyone help me a bit?
Greetings,
Tom
edit2: Is it possible to do it like this?
//create png for tests
$testPng = imagecreatefrompng( $file );
//test how many colors are used
$meta .= 'colors: ' . imagecolorstotal( $testPng );
$meta .= ' truecolor: ' . imageistruecolor( $testPng );
//destroy the test image
imagedestroy( $testPng );
And if truecolor is false or not set, it is a png24?
getimagesize()
seems to do the trick:doesn't even need GD.