Code example for ExifInterface

Methods: getAttributeInt

1
        } 
    } 
 
    public int getPictureRotation() throws IOException { 
        ExifInterface exif = getExifInterface();
        int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1);
 
        switch (orientation) {
            case ExifInterface.ORIENTATION_ROTATE_90:
                return 90; 
            case ExifInterface.ORIENTATION_ROTATE_180:
                return 180; 
            case ExifInterface.ORIENTATION_ROTATE_270:
                return 270; 
            default: 
                return 0; 
        } 
    } 
 
    protected ExifInterface getExifInterface() throws IOException {
        return new ExifInterface(getTempCaptureFile().getAbsolutePath());
    } 
 
    protected Bitmap rotateBitmap(Bitmap bitmap, int rotationDegree) throws IOException {
        Matrix matrix = new Matrix();
        matrix.postRotate(rotationDegree);
Experience pair programming with AI  Get Codota for Java