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. git-svn-id: https://develop.svn.wordpress.org/trunk@40129 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5ab0154647
commit
8e39edfdf6
|
@ -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.
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue