Check if a JPEG image has EXIF Orientation tag and rotate it if needed.
Description
As ImageMagick copies the EXIF data to the flipped/rotated image, proceed only if EXIF Orientation can be reset afterwards.
Source
public function maybe_exif_rotate() {
if ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) {
return parent::maybe_exif_rotate();
} else {
return new WP_Error( 'write_exif_error', __( 'The image cannot be rotated because the embedded meta data cannot be updated.' ) );
}
}
Changelog
Version | Description |
---|---|
5.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.