#33051 closed defect (bug) (duplicate)
Pictures rotated 90 degrees left on upload
Reported by: | rdlynch | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.4.2 |
Component: | Media | Keywords: | needs-patch |
Focuses: | Cc: |
Description
When a user upoads a photo from an iPhone 5s (not sure about iPhone 6) in portrait mode the image is rotated 90 degrees left, and the user must login to WP admin to edit the image and rotate it 90 degrees right for proper orientation. This issue is detailed in this support forum post a year ago. Somehow WP needs to detect the meta data from the image and not rotate the image.
Attachments (2)
Change History (13)
This ticket was mentioned in Slack in #core by johnbillion. View the logs.
9 years ago
#3
@
9 years ago
I'm pretty sure that this is an issue with the Exif orientation tag (http://sylvana.net/jpegcrop/exif_orientation.html) which iOS and OS X are using to rotate the image.
#4
@
9 years ago
I can confirm this (iPhone 5s, iOS 9). No difference with screen lock on/off.
Sounds like an easy to fix. The Image Rotation Repair plugin doesn't exist without a reason.
There are some great articles about EXIF orientation on the web, like http://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/ for instance.
I'll see if I can move that plugin into a patch.
#5
@
9 years ago
- Keywords needs-patch added; needs-testing removed
Hey, just ran into this! Some browsers will respect the orientation field in the EXIF data, others will not. So the fun surprise is that the image is oriented correctly in some browsers and not in others! Patch forthcoming.
#6
@
9 years ago
OK, first pass at a patch added, but something weird is going on. It seems the issue is when an image gets rotated but the orientation field in the EXIF data doesn't get changed. I'm not actually sure how to identify this, but if somebody has an idea I'm all ears.
Here are examples of pretty much the same file. test1, if uploaded with the patch applied, will appear correctly. test2, if uploaded with the patch applied, will actually be over-rotated.
http://trunk.wpdavis.com/test1.jpg => Exif: http://trunk.wpdavis.com/test1.php
http://trunk.wpdavis.com/test2.jpg => Exif: http://trunk.wpdavis.com/test2.php
Another concern: rotating the image on upload destroys the rest of the Exif data, so things like caption, copyright, camera info etc. aren't preserved (at least using the GD library), and they obviously need to be.
#7
@
9 years ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
#8
@
9 years ago
- Version 4.2.2 deleted
I think it does not work in Wordpress 4.4.2, does it? When I try to upload a iPhone photo, the scaled versions are still rotated.
Thank you for the report, rdlynch, and welcome to WordPress Trac.
Can we narrow down where the problem lies? I'd imagine that if this was widespread, we'd see many more reports of it. I suspect that this is either to do with the image processing library on the server, or the image's meta data is being stripped at some point during the steps described in the forum post linked above.