Make WordPress Core


Ignore:
Timestamp:
02/25/2017 05:25:40 AM (8 years ago)
Author:
mikeschroder
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r39580 r40123  
    550550            $this->image->rotateImage( new ImagickPixel('none'), 360-$angle );
    551551
     552            // Normalise Exif orientation data so that display is consistent across devices.
     553            $this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT );
     554
    552555            // Since this changes the dimensions of the image, update the size.
    553556            $result = $this->update_size();
Note: See TracChangeset for help on using the changeset viewer.