From f0152dc74c8e8cc06f266d93e3d83dd92b221087 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Tue, 19 Apr 2016 20:46:30 +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. Merge of [37192] to the 4.5 branch. Props gblsm. Fixes #36501. Built from https://develop.svn.wordpress.org/branches/4.5@37245 git-svn-id: http://core.svn.wordpress.org/branches/4.5@37211 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-image-editor-imagick.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index 7632cbb4ba..74ba793be7 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index adfb1a82b7..b7e8eac66a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5.1-alpha-37187'; +$wp_version = '4.5.1-alpha-37245'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.