Affects Version/s: None
Nexus S, Android 4.1.2, Ti SDK 3.1.1.GA, tool-api-level 17, targetSdkVersion 13
The picture is always recorded in landscape, but when the device is in portrait mode the orientation flag in EXIF indicates that the picture should be rotated to portrait whenever some app wants to shown pictures in the right orientation. That applies to Titanium apps too.
The thing is using either Ti.Blob.imageAsResized or imageAsThumbnail methods on Android removes the orientation flag from the resulting image. Thus any app that wants to show the new image will not be able to determine if the the image should be displayed in landscape or portrait mode and will default to landscape, causing portrait images to be seen sideways.
The included code sample shows that happening on Android.
The desired behaviour would be Android's implementation of Ti.Blob.imageAsResized and imageAsThumbnail keeping the orientation flag intact in the new image data. The iOS implementation of these methods works fine and it would be reasonable to have both platforms offering the same semantics for this use case.
I figure out that Titanium.Blob.imageAsResized and Titanium.Blob.imageAsThumbnail generate images that don't include exif data on Android. Thus, photos captured in portrait mode and resized with one of this methods are always displayed in landscape mode when using ImageView, even when autorotate = true.
I can do a workaround rotating the ImageView, but it doesn't work when we're using leftImage or rightImage of a TableViewRow.
The code bellow works fine on iOS, but not on Android.