From 09e9e53c30276803406c8572ae4d2284a794c2b6 Mon Sep 17 00:00:00 2001 From: Mike Schroder Date: Wed, 13 Apr 2016 06:17:25 +0000 Subject: [PATCH] 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 --- src/wp-includes/class-wp-image-editor-imagick.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-image-editor-imagick.php b/src/wp-includes/class-wp-image-editor-imagick.php index 7632cbb4ba..74ba793be7 100644 --- a/src/wp-includes/class-wp-image-editor-imagick.php +++ b/src/wp-includes/class-wp-image-editor-imagick.php @@ -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 );