I had the orientation issue when working with ACTION_IMAGE_CAPTURE
activity. I have used the TAG_ORIENTATION
so that I would rotate the picture accordingly. But now we found that on some newer devices this doesn't work. In fact it returns 1 for all orientations.
Here's the list of devices we observed this on;
- Samsung Infuse 4G (2.3.3)
- Samsung Galaxy SII X (2.3.5)
- Sony Xperia Arc (2.3.3)
Interesting thing is that once this image is the gallery it shows up properly and if I select it, the TAG_ORIENTATION
is populated properly. So somehow the OS
fills this information properly but not on ActivityResult
.
What's the most reliable way to figure the orientation? Someone on another question suggested comparing height and width but when getting these, they are properly switched based on orientation (another mystery)
EDIT: It seems that this could be connected to another bug where the OS duplicates the image taken in the gallery (it's only supposed to save the image in the URL specified by us), the thing is this image in gallery has the ORIENTATION
information while the one in the specified location doesn't.
This is the bug; http://code.google.com/p/android/issues/detail?id=19268
EDIT-2: I've filed a new bug with Android. I'm pretty sure this is an OS bug related the aforementioned bug. http://code.google.com/p/android/issues/detail?id=22822