- SDK: 2.1.2GA
- Platform: Android
- Devices: Droid Incredible running 2.3.4, and a Samsung Galaxy running 4.0.something
- Host OS: OSX 10.8.1
- Titanium Studio: 18.104.22.168208301612
So, I've built an app that among other things takes photos and does stuff to them. Blah blah blah. It works wonderfually on iOS and Android 2.2 and 2.3.
I tested the app on a colleague's Samsung running ICS and the photos are rotated, by 90 degrees. I tried running my app in the emulator, and the photos are not only rottated by 90 degrees, but they're flipped about the vertical axis as well.
Now, I've spent the last several hours dissecting this and cogitating. Here are my observations:
- If I query Ti.Gesture.orientation in the Ti.Media.showCamera success callback, it always reports LANDSCAPE_RIGHT. WTF.
- My android emulator running 4.1.1 seems to flip photos about the vertical axis, which implies to me it's pretending to use the front camera instead of the main camera. This is probably a red herring, but I'd love to know how to swap or work around this
- When a photo is taken with the phone in portrait orientation, the result image is rotated by 90 degrees CW
- When a photo is taken with the phone in and landscape orientation, the result image is rotated by 90 degrees CW
I know I could just rotate my images by 90 CCW to fix, but I want to understand the underlying problem. WHat exactly is going on here?
FINALLY: To repeat my earlier statement, this works fine in 2.2 and 2.3 - this must be some new behavior in 4.0+
This is a common, non-Titanium-specific, Android problem. http://stackoverflow.com/questions/8865183/android-rotates-pictures-by-90-degrees-taken-by-camera
Think you can help? Login to answer this question!