Make WordPress Core

Changeset 37192


Ignore:
Timestamp:
04/13/2016 06:17:25 AM (8 years ago)
Author:
mikeschroder
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r36996 r37192  
    377377            if ( is_callable( array( $this->image, 'getImageAlphaChannel' ) )
    378378                && is_callable( array( $this->image, 'setImageAlphaChannel' ) )
    379                 && defined( Imagick::ALPHACHANNEL_UNDEFINED )
    380                 && defined( Imagick::ALPHACHANNEL_OPAQUE )
     379                && defined( 'Imagick::ALPHACHANNEL_UNDEFINED' )
     380                && defined( 'Imagick::ALPHACHANNEL_OPAQUE' )
    381381            ) {
    382382                if ( $this->image->getImageAlphaChannel() === Imagick::ALPHACHANNEL_UNDEFINED ) {
Note: See TracChangeset for help on using the changeset viewer.