summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoModule.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-rw-r--r--src/com/android/camera/PhotoModule.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 33892ddba..50071be09 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -284,6 +284,7 @@ public class PhotoModule
private boolean mMirror;
private boolean mFirstTimeInitialized;
private boolean mIsImageCaptureIntent;
+ private int mOrientationOffset;
private int mCameraState = INIT;
private boolean mSnapshotOnIdle = false;
@@ -547,6 +548,7 @@ public class PhotoModule
mActivity = activity;
mRootView = parent;
mPreferences = new ComboPreferences(mActivity);
+ mOrientationOffset = CameraUtil.isDefaultToPortrait(mActivity) ? 0 : 90;
CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), activity);
mCameraId = getPreferredCameraId(mPreferences);
mContentResolver = mActivity.getContentResolver();
@@ -1655,7 +1657,7 @@ public class PhotoModule
}
// Set rotation and gps data.
- int orientation = mOrientation;
+ int orientation = (mOrientation + mOrientationOffset) % 360;
mJpegRotation = CameraUtil.getJpegRotation(mCameraId, orientation);
String pictureFormat = mParameters.get(KEY_PICTURE_FORMAT);
Location loc = getLocationAccordPictureFormat(pictureFormat);
@@ -2092,6 +2094,7 @@ public class PhotoModule
// the camera then point the camera to floor or sky, we still have
// the correct orientation.
if (orientation == OrientationEventListener.ORIENTATION_UNKNOWN) return;
+ orientation = (orientation - mOrientationOffset + 360) % 360;
int oldOrientation = mOrientation;
mOrientation = CameraUtil.roundOrientation(orientation, mOrientation);
if (oldOrientation != mOrientation) {