mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
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:
parent
9dcfd91833
commit
5102c98ab6
@ -376,8 +376,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||||||
*/
|
*/
|
||||||
if ( is_callable( array( $this->image, 'getImageAlphaChannel' ) )
|
if ( is_callable( array( $this->image, 'getImageAlphaChannel' ) )
|
||||||
&& is_callable( array( $this->image, 'setImageAlphaChannel' ) )
|
&& is_callable( array( $this->image, 'setImageAlphaChannel' ) )
|
||||||
&& defined( Imagick::ALPHACHANNEL_UNDEFINED )
|
&& defined( 'Imagick::ALPHACHANNEL_UNDEFINED' )
|
||||||
&& defined( Imagick::ALPHACHANNEL_OPAQUE )
|
&& defined( 'Imagick::ALPHACHANNEL_OPAQUE' )
|
||||||
) {
|
) {
|
||||||
if ( $this->image->getImageAlphaChannel() === Imagick::ALPHACHANNEL_UNDEFINED ) {
|
if ( $this->image->getImageAlphaChannel() === Imagick::ALPHACHANNEL_UNDEFINED ) {
|
||||||
$this->image->setImageAlphaChannel( Imagick::ALPHACHANNEL_OPAQUE );
|
$this->image->setImageAlphaChannel( Imagick::ALPHACHANNEL_OPAQUE );
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user