[wp-trac] [WordPress Trac] #14459: Rotate Full Size Images on Upload
WordPress Trac
noreply at wordpress.org
Thu Jul 28 14:49:50 UTC 2016
#14459: Rotate Full Size Images on Upload
-------------------------------------------+-----------------------------
Reporter: mrroundhill | Owner: azaozz
Type: enhancement | Status: reviewing
Priority: normal | Milestone: Future Release
Component: Upload | Version: 3.0
Severity: normal | Resolution:
Keywords: needs-patch westi-like mobile | Focuses:
-------------------------------------------+-----------------------------
Comment (by triplejumper12):
Replying to [comment:44 lukecavanagh]:
> @msaggiorato
>
> You should be able to keep the EXIF information and use
>
> http://php.net/manual/en/imagick.getimageorientation.php
Using Imagick's getImageOrientation is probably preferable to using
exif_read_data, because exif_read_data can throw an error for some jpegs
depending on how they have been modified in the past. getImageOrientation
seemed to be more reliable and does the logic of finding the orientation
from the exif data itself.
However, getImageOrientation will return the same orientation after an
image has been rotated, so you would still have to remove the orientation
or set it to 1 after you rotate it. Unfortunately, Imagick doesn't adjust
the orientation when you rotate it like GD does.
Thought that might be helpful since I ran into this while trying to fix
orientations on upload. I don't have any examples of the images this
failed on anymore, but just something you might want to consider.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/14459#comment:47>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list