Make WordPress Core


Ignore:
Timestamp:
02/27/2017 04:21:41 AM (8 years ago)
Author:
mikeschroder
Message:

Media: After [40123], Feature check setImageOrientation.

In [40123], WP_Image_Editor_Imagick started using
Imagick::setImageOrientation and Imagick::ORIENTATION_TOPLEFT,
but had no equivalent feature check.

While they were introduced more than 9 years ago, it's important
to double-check everything is available before using with Imagick.

Fixes #37140.

File:
1 edited

Legend:

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

    r40123 r40129  
    551551
    552552            // Normalise Exif orientation data so that display is consistent across devices.
    553             $this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT );
     553            if ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) {
     554                $this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT );
     555            }
    554556
    555557            // Since this changes the dimensions of the image, update the size.
Note: See TracChangeset for help on using the changeset viewer.