How to revert back the flipped picture from front camera in android?

222 Views Asked by At

Can not figure out for couple of days now how to resolve my flipped picture from front camera on Android 4.

I want to rotate them on this way, but for some reason android don`t detect rule for front facing camera and OS version.

    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;

    Camera.CameraInfo info = new Camera.CameraInfo();
    android.hardware.Camera.getCameraInfo(0, info);
    if (android.os.Build.VERSION.SDK_INT>13 && info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
    {
        return 270;
    }
    else {
        return 90;
    }

Any suggestions?

0

There are 0 best solutions below