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
This commit is contained in:
parent
a367bb8b59
commit
f0152dc74c
|
@ -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 );
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue