OpenOversight
OpenOversight copied to clipboard
Bug: photos are upright in tagging workflow but rotated 90° when cropped
I’ve seen this happen with a set of photos that came from a particular camera/phone, and I have a hunch for the cause. First — a user story:
- Given I am logged in
- And I have permissions to tag faces in photos
- When I am tagging a face in a certain photo
- And the photo appears at the correct orientation in the tagging interface
- Then I see the cropped officer tag is rotated 90º from how it had appeared in the tagging interface
- And the size and shape of the crop are true to how I had input them
Expected result: the cropped image is “upright” in the same orientation as the tagging interface Actual result: certain cropped images are rotated 90º (most frequently counter clockwise)
Example image: https://www.openoversight.com/officer/12035
My suspicion is the tagging interface is correctly using an EXIF property like orientation
, e.g:
- https://jdhao.github.io/2019/07/31/image_rotation_exif_info/
- https://sirv.com/help/articles/rotate-photos-to-be-upright/
…and then the processing routine is either ignoring that value or incorrectly applying the orientation.
Reproducible with EXIF:
Orientation: 6 (Rotated 90° CCW)
(iPhones and iPads happen to produce images like this)
Thanks for your work on this @parhamr I ran into a similar problem, might be the same problem or connected, so adding it here. When tagging I ran into several photos that are shown rotated by 90° https://openoversight.com/cop_face/department/1/image/1593, but the image as it comes from S3 is shown in the right orientation in the browser. When I tag a cop in that rotated image it ends up tagged 180° rotated. Example of that: On https://openoversight.com/cop_face/department/1/image/3056 (appearing 90° rotated clockwise) I tagged https://openoversight.com/officer/12982 on the "right", but ended up with the legs of the officer on the left.