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 665e3db40..24bf3dd73 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -312,6 +312,7 @@ public class PhotoModule private boolean mMirror; private boolean mFirstTimeInitialized; private boolean mIsImageCaptureIntent; + private int mOrientationOffset; private int mCameraState = INIT; private boolean mSnapshotOnIdle = false; @@ -583,6 +584,7 @@ public class PhotoModule 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); @@ -1856,7 +1858,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); @@ -2358,6 +2360,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) { |