diff --git a/src/wp-includes/class-wp-image-editor-imagick.php b/src/wp-includes/class-wp-image-editor-imagick.php index 34dd539375..3589cc22a1 100644 --- a/src/wp-includes/class-wp-image-editor-imagick.php +++ b/src/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();