I am lot of stuff for finding Camera rotation(Angle -0,90,180,270) after IMAGE_CAPTURE but not getting correct rotation degree. I am using ExifInterface class but getting "0" or "1".
//Image Capture
final static int CAMERA_OUTPUT = 0;
File file;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.camerapreview);
Intent i = new Intent("android.media.action.IMAGE_CAPTURE");
file = new File(Environment.getExternalStorageDirectory().getPath() + "/Images/" + image_name + ".jpg");
intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
startActivityForResult(i, CAMERA_RESULT);
}
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (resultCode == RESULT_OK)
{
ExifInterface ei = new ExifInterface(file.getAbsoultePath());
int orientation = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
//In Log getting 0 or 1 issue
Log.d("tag","Rotation is "+orientation);
}
}
Please give some idea how to get rotation degree after image capture.