I have a camera app in portrait mode which takes pictures from both front and back end cameras.The issue is like the captured images are rotated in a wrong way...
For pr
I'm using the following code for this:
ExifInterface exif = new ExifInterface(getUriPath(uri));
int orientation = exif.getAttributeInt(
ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_NORMAL);
getUriPath:
public String getUriPath(Uri uri) {
String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(uri, projection, null, null,
null);
if (cursor != null) {
int column_index = cursor.getColumnIndexOrThrow(projection[0]);
cursor.moveToFirst();
String filePath = cursor.getString(column_index);
cursor.close();
return filePath;
} else
return null;
}