note 126859 added to imagick.getimagealphachannel
| From: | phroggar at main dot php dot net | Date: | Thu, 17 Feb 2022 08:54:00 +0000 |
| Subject: | note 126859 added to imagick.getimagealphachannel | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217626@lists.php.net to get a copy of this message | ||
You want to check wether an image has an alpha channel? But you have no control which Imagick
Version is used?
Background:
Method available since ImageMagick 6.4.0
Method returns boolean instead of int since 6.9.x
Example:
$image= new Imagick();
$image->readImage($source_file);
$imageHasAlphaChannel = (method_exists($image, 'getImageAlphaChannel') &&
($document->getImageAlphaChannel() === \Imagick::ALPHACHANNEL_ACTIVATE ||
$document->getImageAlphaChannel() === true));
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.135 (proxied: 217.91.239.72)
----
Manual Page -- https://php.net/manual/en/imagick.getimagealphachannel.php
Edit -- https://main.php.net/note/edit/126859
Del: integrated -- https://main.php.net/note/delete/126859/integrated
Del: useless -- https://main.php.net/note/delete/126859/useless
Del: bad code -- https://main.php.net/note/delete/126859/bad+code
Del: spam -- https://main.php.net/note/delete/126859/spam
Del: non-english -- https://main.php.net/note/delete/126859/non-english
Del: in docs -- https://main.php.net/note/delete/126859/in+docs
Del: other reasons-- https://main.php.net/note/delete/126859
Reject -- https://main.php.net/note/reject/126859
Search -- https://main.php.net/manage/user-notes.php