Example usage for android.media ExifInterface ORIENTATION_ROTATE_270

List of usage examples for android.media ExifInterface ORIENTATION_ROTATE_270

Introduction

In this page you can find the example usage for android.media ExifInterface ORIENTATION_ROTATE_270.

Prototype

int ORIENTATION_ROTATE_270

To view the source code for android.media ExifInterface ORIENTATION_ROTATE_270.

Click Source Link

Usage

From source file:Main.java

private static int exifToDegrees(int exifOrientation) {
    switch (exifOrientation) {
    case ExifInterface.ORIENTATION_ROTATE_90:
        return 90;
    case ExifInterface.ORIENTATION_ROTATE_180:
        return 180;
    case ExifInterface.ORIENTATION_ROTATE_270:
        return 270;
    default:/*from ww  w .j  a  v a 2 s . c o m*/
        return 0;
    }
}

From source file:Main.java

private static int exifToDegrees(int exifOrientation) {
    if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {
        return 90;
    } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180) {
        return 180;
    } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270) {
        return 270;
    }//w  w  w.  j  a v  a  2 s.  c om
    return 0;
}

From source file:Main.java

public static int[] getBitmapRealSize(int[] size, int orientation) {
    if (size == null || size.length != 2) {
        size = new int[2];
        return size;
    }//from   ww w  .  j a v a2 s.co  m
    int w = size[0];
    int h = size[1];
    switch (orientation) {
    case ExifInterface.ORIENTATION_ROTATE_270:
    case ExifInterface.ORIENTATION_ROTATE_90:
        size[0] = h;
        size[1] = w;
        break;
    }
    return size;
}

From source file:Main.java

public static float getDegree(int exifOrientation) {
    if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90)
        return 180;
    else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180)
        return 270;
    else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270)
        return 0;

    return 90;//from www.j av  a  2 s.  co m
}

From source file:Main.java

public static float exifOrientationToDegrees(int exifOrientation) {

    if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {

        return 90;

    } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180) {

        return 180;

    } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270) {

        return 270;

    }/*w  w  w  .j  a  v  a 2 s  . c  o m*/

    return 0;

}

From source file:Main.java

private static float exifOrientationToDegrees(int exifOrientation) {
    float angle;/* www . ja v a2 s.  co  m*/
    switch (exifOrientation) {
    case ExifInterface.ORIENTATION_ROTATE_90:
        angle = 90;
        break;
    case ExifInterface.ORIENTATION_ROTATE_180:
        angle = 180;
        break;
    case ExifInterface.ORIENTATION_ROTATE_270:
        angle = 270;
        break;
    default:
        angle = 0;
        break;
    }
    return angle;
}

From source file:Main.java

public static int getOrientationFromExif(String imagePath) {
    int orientation = 0;
    try {//from   www  . j  av a 2  s.com
        ExifInterface exif = new ExifInterface(imagePath);
        int exifOrientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION,
                ExifInterface.ORIENTATION_NORMAL);

        switch (exifOrientation) {
        case ExifInterface.ORIENTATION_ROTATE_270:
            orientation = 270;

            break;
        case ExifInterface.ORIENTATION_ROTATE_180:
            orientation = 180;

            break;
        case ExifInterface.ORIENTATION_ROTATE_90:
            orientation = 90;

            break;

        case ExifInterface.ORIENTATION_NORMAL:
            orientation = 0;

            break;
        default:
            break;
        }
    } catch (Exception e) {

    }

    return orientation;
}

From source file:Main.java

private static int decodeExifOrientation(int orientation) {
    switch (orientation) {
    case ExifInterface.ORIENTATION_NORMAL:
        orientation = 0;//from   w ww . j av a2 s  .c om
        break;
    case ExifInterface.ORIENTATION_ROTATE_90:
        orientation = 90;
        break;
    case ExifInterface.ORIENTATION_ROTATE_180:
        orientation = 180;
        break;
    case ExifInterface.ORIENTATION_ROTATE_270:
        orientation = 270;
        break;
    default:
        break;
    }
    return orientation;
}

From source file:Main.java

/**
 * Converts the given Exif Orientation to a degree for rotation.
 * //from  w w  w.j  a v a2s  . c  o  m
 * @param exifOrientation
 *            the ExifInterface code for the orientation
 * @return the rotation as a <code>float</code>
 */
private static float exifOrientationToDegrees(int exifOrientation) {
    if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {
        return 90;
    } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180) {
        return 180;
    } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270) {
        return 270;
    }
    return 0;
}

From source file:Main.java

/**
 * Gets the Amount of Degress of rotation using the exif integer to determine how much
 * we should rotate the image.//from w  ww  .  j av  a  2  s.co  m
 * @param exifOrientation - the Exif data for Image Orientation
 * @return - how much to rotate in degress
 */
private static int exifToDegrees(int exifOrientation) {
    if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {
        return 90;
    } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180) {
        return 180;
    } else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270) {
        return 270;
    }
    return 0;
}