From 454acad22e809f58855488539f19aeee35f38cbc Mon Sep 17 00:00:00 2001 From: Mike Schroder Date: Sat, 25 Feb 2017 05:26:41 +0000 Subject: [PATCH] Media: Reset Exif orientation after rotate in `WP_Image_Editor_Imagick`. Due to inconsistencies in the way browsers handle Exif orientation data, if a user manually rotates an image within WordPress, set the Exif orientation to the default (1) so that the image displays with the same rotation/flip in every browser. Props sanchothefat, triplejumper12, joemcgill, azaozz, markoheijnen, mikeschroder. See #14459. Fixes #37140. Built from https://develop.svn.wordpress.org/trunk@40123 git-svn-id: http://core.svn.wordpress.org/trunk@40060 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-image-editor-imagick.php | 3 +++ wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index 8f9b43cb89..34dd539375 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -549,6 +549,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { try { $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 ); + // Since this changes the dimensions of the image, update the size. $result = $this->update_size(); if ( is_wp_error( $result ) ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 6c0a7e9471..fa63549437 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40122'; +$wp_version = '4.8-alpha-40123'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.