espen / balder

Balder - Open source Ruby on Rails photo gallery
http://balderapp.com
MIT License
263 stars 97 forks source link

Auto-orient images if EXIF data recommends it #44

Closed rick closed 9 years ago

rick commented 10 years ago

This is just a pass through to *magick on the back-end, but it corrects orientation on images where the camera was rotated.

espen commented 10 years ago

Where is it reading the EXIF? I am not familiar with the attribute data here. Will this change orientation for all photos that were taken when the camera was rotated?

rick commented 10 years ago

At upload time, when it's doing the initial conversion with mini-magic, if there was EXIF data from the camera in the image that says "hey, this picture was taken with a camera rotated 90 degrees" then it will rotate the picture. I pulled in about 400 pics last night, only some of the cameras provided the advice, and only a few of the photos were taken rotated -- but the ones where the EXIF data said the camera was rotated were the ones I would've wanted it to rotate. I dropped the photos, turned on the auto-orient and re-imported and things looked good.