In my application Image is getting rotated when it is clicked from camera in portrait mode, this happens only for samsung device and for the rest it works fine. I implemented following code after researching in stack overflow:
ExifInterface ei = new ExifInterface(imgFile.getPath());
int orientation = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED);
switch (orientation) {
case ExifInterface.ORIENTATION_UNDEFINED:
mBitmap = rotateImage(bitmap, 90);
break;
}
This code helps me to fix that issue in samsung but now when image is clicked from camera it is getting rotated in other devices due to this piece of code.
Please let me know how can I fix this issue.