Reputation: 593
I am trying to get the orientation of an image (from gallery), but ExifInterface always returns 0. here is the code:
int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED);
Upvotes: 3
Views: 602
Reputation: 3968
A bit late to the party, but I hope to help other developers struggling with this.
What helped me fix the issue was using:
android.support.media.ExifInterface
instead of
android.media.ExifInterface
It seems the ExifInterface
from the support library does a better job at handling the various orientations. Please pay attention to the warnings the IDE gives. My warning was hiding inside a collapsed list of imports.
Upvotes: 1