summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormingwax <mingwax@codeaurora.org>2017-02-28 14:59:42 +0800
committerArne Coucheron <arco68@gmail.com>2017-06-13 07:18:47 +0200
commitfffbe39d98024cae932df964c9a587104397f2de (patch)
tree0f16f284fa9958529947f4353309e0e7692a6172
parentdd1b09c00fd6e07d85d3ba7f807dee207f84e154 (diff)
downloadandroid_packages_apps_Snap-fffbe39d98024cae932df964c9a587104397f2de.tar.gz
android_packages_apps_Snap-fffbe39d98024cae932df964c9a587104397f2de.tar.bz2
android_packages_apps_Snap-fffbe39d98024cae932df964c9a587104397f2de.zip
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
-rw-r--r--src/com/android/camera/PhotoModule.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index d808fa6bb..fb4db8c10 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1265,9 +1265,7 @@ public class PhotoModule extends BaseModule<PhotoUI> 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);