Media: Resolve fatal error on resize with ImageMagick < 6.4.6
Improper checking for 'Imagick::ALPHACHANNEL_UNDEFINED' and 'Imagick::ALPHACHANNEL_OPAQUE' caused fatal errors for some users with Imagick when compiled against ImageMagick < 6.4.6, when these constants were introduced. Fixes these compatibility checks. Props gblsm. Fixes #36501. git-svn-id: https://develop.svn.wordpress.org/trunk@37192 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1af1c2d30f
commit
09e9e53c30
|
@ -376,8 +376,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||
*/
|
||||
if ( is_callable( array( $this->image, 'getImageAlphaChannel' ) )
|
||||
&& is_callable( array( $this->image, 'setImageAlphaChannel' ) )
|
||||
&& defined( Imagick::ALPHACHANNEL_UNDEFINED )
|
||||
&& defined( Imagick::ALPHACHANNEL_OPAQUE )
|
||||
&& defined( 'Imagick::ALPHACHANNEL_UNDEFINED' )
|
||||
&& defined( 'Imagick::ALPHACHANNEL_OPAQUE' )
|
||||
) {
|
||||
if ( $this->image->getImageAlphaChannel() === Imagick::ALPHACHANNEL_UNDEFINED ) {
|
||||
$this->image->setImageAlphaChannel( Imagick::ALPHACHANNEL_OPAQUE );
|
||||
|
|
Loading…
Reference in New Issue