You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Mariovc - // After using URI from FileProvider ExifInterface is not providing orientation details when we ftech image from camera i have tested it in api 14 to api 24, the code works for Android M only.
`private static int getRotationFromCamera(Context context, Uri imageFile)
{
int rotate = 0;
try
{
context.getContentResolver().notifyChange(imageFile, null);
// URI from FileProvider Not providing ORIENTATION details for ExifInterface for api 14 to api 24
ExifInterface exif = new ExifInterface(imageFile.getPath());
int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION,ExifInterface.ORIENTATION_NORMAL);
switch (orientation)
{
case ExifInterface.ORIENTATION_ROTATE_270:
rotate = 270;
break;
case ExifInterface.ORIENTATION_ROTATE_180:
rotate = 180;
break;
case ExifInterface.ORIENTATION_ROTATE_90:
rotate = 90;
break;
default:
rotate = 0;
break;
}
}
catch (Exception e)
{
e.printStackTrace();
}
return rotate;
}`
The text was updated successfully, but these errors were encountered:
@Mariovc - // After using URI from FileProvider ExifInterface is not providing orientation details when we ftech image from camera i have tested it in api 14 to api 24, the code works for Android M only.
`private static int getRotationFromCamera(Context context, Uri imageFile)
{
int rotate = 0;
try
{
context.getContentResolver().notifyChange(imageFile, null);
The text was updated successfully, but these errors were encountered: