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. Merges [40123] and [40129] to the 4.7 branch. Fixes #37140. See #14459. Built from https://develop.svn.wordpress.org/branches/4.7@40135 git-svn-id: http://core.svn.wordpress.org/branches/4.7@40072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4771761186
commit
d9ce7b2739
|
@ -549,6 +549,11 @@ 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.
|
||||
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();
|
||||
if ( is_wp_error( $result ) )
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7.3-alpha-40134';
|
||||
$wp_version = '4.7.3-alpha-40135';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue