Image orientation and ExifInterface
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 with this line:
ExifInterface ei = new ExifInterface(photoPath);
In this code photoPath is a String, but I don't have any String path! I have a Bitmap loaded in the memory inside a Bitmap! How can I set the path for ExifInterface?