Code example for ExifInterface

Methods: getAttributeInt

0
		options.inSampleSize = 4; 
 
		Bitmap bitmap = BitmapFactory.decodeFile(_path, options); 
 
		try { 
			ExifInterface exif = new ExifInterface(_path); 
			int exifOrientation = exif.getAttributeInt( 
					ExifInterface.TAG_ORIENTATION, 
					ExifInterface.ORIENTATION_NORMAL); 
 
			Log.v(TAG, "Orient: " + exifOrientation); 
 
			int rotate = 0; 
 
			switch (exifOrientation) { 
			case ExifInterface.ORIENTATION_ROTATE_90: 
				rotate = 90; 
				break; 
			case ExifInterface.ORIENTATION_ROTATE_180: 
				rotate = 180; 
				break;