I want to get orientation of a bitmap. i use this code:
ExifInterface ei = new ExifInterface(photoPath);
int orientation = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_NORMAL);
switch(orientation) {
case ExifInterface.ORIENTATION_ROTATE_90:
rotateImage(bitmap, 90);
break;
case ExifInterface.ORIENTATION_ROTATE_180:
rotateImage(bitmap, 180);
break;
// etc.
}
My problem is this line:
ExifInterface ei = new ExifInterface(photoPath);
in this code photoPath is an String but i don't have any String path! i have a Bitmap loaded in memory inside a Bitmap! how i can set the path for ExifInterface ?