diff options
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index c9fe96006..2a902e22e 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -289,6 +289,7 @@ public class PhotoModule extends BaseModule<PhotoUI> implements private boolean mMirror; private boolean mFirstTimeInitialized; private boolean mIsImageCaptureIntent; + private int mOrientationOffset; private int mCameraState = INIT; private boolean mSnapshotOnIdle = false; @@ -556,6 +557,7 @@ public class PhotoModule extends BaseModule<PhotoUI> implements public void init(CameraActivity activity, View parent) { mActivity = activity; mRootView = parent; + mOrientationOffset = CameraUtil.isDefaultToPortrait(mActivity) ? 0 : 90; mPreferences = ComboPreferences.get(mActivity); if (mPreferences == null) { mPreferences = new ComboPreferences(mActivity); @@ -1704,7 +1706,7 @@ public class PhotoModule extends BaseModule<PhotoUI> implements } // 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); @@ -2181,6 +2183,7 @@ public class PhotoModule extends BaseModule<PhotoUI> implements // 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) { |