From fffbe39d98024cae932df964c9a587104397f2de Mon Sep 17 00:00:00 2001 From: mingwax Date: Tue, 28 Feb 2017 14:59:42 +0800 Subject: SnapdragonCamera: Fix photo reversed when enable selfie Mirror When camera is opened with front camera, enable SelfieMirror in horizontal screen. When jpegData`s exif `s orientation is enabled, set the image rotation angle of 180 degrees to ensure the picture is right direction. SDM660 installed front camera is 270 degree. MSM8998 installed front camera is 90 degree. CRs-Fixed: 1112749 Change-Id: I350f588142215e7b0793d1aa6dc573bad239baac --- src/com/android/camera/PhotoModule.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index d808fa6..fb4db8c 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -1265,9 +1265,7 @@ public class PhotoModule extends BaseModule implements private byte[] flipJpeg(byte[] jpegData, int orientation, int jpegOrientation) { Bitmap srcBitmap = BitmapFactory.decodeByteArray(jpegData, 0, jpegData.length); Matrix m = new Matrix(); - if(orientation == 270) { - m.preScale(-1, 1); - } else { //if it's 90 + if(orientation == 270 || orientation == 90) { // Judge whether the picture or phone is horizontal screen if (jpegOrientation == 0 || jpegOrientation == 180) { m.preScale(-1, 1); -- cgit v1.1