From f780259d8805d87fd420fc4462d5f3346bcb4f99 Mon Sep 17 00:00:00 2001 From: Mike Schroder Date: Mon, 27 Feb 2017 04:22:51 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@40129 git-svn-id: http://core.svn.wordpress.org/trunk@40066 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-image-editor-imagick.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index 34dd539375..3589cc22a1 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -550,7 +550,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { $this->image->rotateImage( new ImagickPixel('none'), 360-$angle ); // Normalise Exif orientation data so that display is consistent across devices. - $this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT ); + if ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) { + $this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT ); + } // Since this changes the dimensions of the image, update the size. $result = $this->update_size(); diff --git a/wp-includes/version.php b/wp-includes/version.php index ea1b8ffc52..c927d9f382 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40128'; +$wp_version = '4.8-alpha-40129'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.