globocom/thumbor — pull request #94 by garthomite (2012-06-07 23:48:49+00:00)
Title: EXIF Orientation information is lost after the image is processed

Hey Guys,

I ran in to a problem generating images that were uploaded in portrait mode from devices like iPhones. After the image was processed the original image rotation was lost causing the image to display 90 deg's off.

After some digging around I noticed that when PIL processes the image it removes any EXIF Orientation information so to display the image correctly I had to somehow add the EXIF information manually or rotate the image.

I ended up with the Image rotation.

I'm pretty new with this project so I'm not sure where the best place to put this code would be. Originally I thought about using a filter but this code is PIL specific. I ended up just extending the current PIL engine to keep this code separate.

Not sure if this code is of any value to you but just in case I thought I would pass it along.

Thanks!