0

The orientation of the image captured is causing problems across devices in Android. In some devices the orientation of the image captured is not recorded in the EXIF while in other devices it is recorded. Is there a proper demarcation as to which devices do and which do not?

So, in case the device does not add the image orientation, I use the following code to resolve it http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setRotation%28int%29

But, now in those devices that do support adding the orientation/rotation of the image automatically the above image rotates it further more and the orientation goes wrong again.

Can you please tell if there is a generic code to handle it, or to disable the inbuilt rotation information, or if I can distinguish based on the API Level or absolutely any other way to handle this issue?

Thank you

rahulg
  • 2,183
  • 3
  • 33
  • 47

1 Answers1

0

Try putting the following in the manifest for the activity that captures the image:

<activity
    android:configChanges="orientation"
    android:screenOrientation="portrait" >
</activity>

The android:configChanges setting means that your activity handles changes in orientation itself, so if you then decide not to do anything, it means that the orientation never changes. The android:screenOrientation setting means that it'll always be in portrait mode, but of course you can choose landscape. Hence the effect is that the activity never switches orientation and that just might solve your problem.

Stochastically
  • 7,616
  • 5
  • 30
  • 58