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.
Built from https://develop.svn.wordpress.org/trunk@37192


git-svn-id: http://core.svn.wordpress.org/trunk@37158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mike Schroder 2016-04-13 06:18:28 +00:00
parent 9dcfd91833
commit 5102c98ab6
2 changed files with 3 additions and 3 deletions

View File

@ -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 );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37191';
$wp_version = '4.6-alpha-37192';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.