public static ViewOrientation ofExif(final ExifInterface exif) {
        int orientation = ExifInterface.ORIENTATION_NORMAL;
        if (exif != null) {
            orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
        }
        return ofExif(orientation);
    }
Create orientation from an ExifInterface, which is usually obtained for an Image
main/src/main/java/cgeo/geocaching/utils/ViewOrientation.java