iPhone uploaded image orientation

I'm running into something that after a quick search doesn't seem to be a documented issue. I'm building a site where users have to be able to upload item files by directly snapping a picture on their smartphones. However, regardless of whether the user holds their phone landscape or portrait, the resultant image is always treated as landscape and cropped/rotated as such in Omeka (I feel like most people naturally tend to take images in portrait). Re-rotating the image in a preview or editor and then re-uploading corrects this issue, but I was wondering if there's a way around this issue without having to do this extra step.

Is this problem with the thumbnails, the "original," or both?

Both the thumbnails and the original full size image are wrongly landscape

In general, the problem with this kind of thing is that the phone is merely marking the orientation in the embedded metadata for the file, not actually storing it in the opposite orientation.

Browsers don't read that orientation data, so you get the wrong result as they just read the pixels and display them normally.

ImageMagick can see and respect the orientation flag, but Omeka by design doesn't touch the "original" file.

Basically, if you're only worried about the thumbnail/fullsize images, it should be possible to make sure they get the right orientation. What's odd is that the behavior I've seen in the past is that the thumbnails do get flipped correctly.

Do you have an untouched example of an image that uploads wrong in Omeka?

http://bard-neh.chips-ny.com/collections/show/2

I just took and uploaded the second image of the monitor in portrait orientation, but it gets read as landscape.

Okay, thanks for the example.

So, my explanation was backward and possibly obsolete: now the browsers generally do automatically rotate images using their metadata, given how many come from phones. Omeka's not telling ImageMagick to look at that flag, and it doesn't carry over to the thumbnails we generate, so you see things flipped.

ImageMagick has a simple flag you can use to tell it to respect the metadata for image orientation, and having Omeka use that flag is a small change to the core Omeka files.

We may need to discuss and think over a little bit more whether or not it makes sense to use that flag in regular Omeka release. You can try out the small changes on your own site if you wish, I've posted the patch in a branch of Omeka's GitHub repository.

Thanks for the info/edits. Copied over those imagemagick lines - the thumbnails seem correct now but the original image still seems to be rotated

http://bard-neh.chips-ny.com/items/show/9

So yeah, that's the issue I was alluding to before: Omeka doesn't touch the original file, and we're not going to change that. Keeping the original as-is is a basic tenet of how Omeka operates.

Browsers pretty much seem to not auto-rotate embedded images, and it's inconsistent whether they'll rotate them when viewing them directly (Chrome and Firefox seem to, IE seems not to).

For your use case though, you could just use the "fullsize" image instead of the original, potentially increasing the configured fullsize limit if you want larger images.