summaryrefslogtreecommitdiffstats
path: root/src/org/codeaurora
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-07-25 18:16:26 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-21 18:46:32 -0700
commit32a48ddad42992def1acb070affd62817d06e050 (patch)
treeb3585609d417a26cff2060d0e590693df4cf0a7b /src/org/codeaurora
parent0e7092ef14cf92663831a615c0aa63ab672e476e (diff)
downloadandroid_packages_apps_Snap-32a48ddad42992def1acb070affd62817d06e050.tar.gz
android_packages_apps_Snap-32a48ddad42992def1acb070affd62817d06e050.tar.bz2
android_packages_apps_Snap-32a48ddad42992def1acb070affd62817d06e050.zip
SnapdragonCamera: Provide correct orientation when adding image
Read orientation from exif and provide to content provider when adding image. CRs-Fixed: 993611 Change-Id: Ic2079dd1b5e6bdb93f73b4084749b3cbc68b3f86
Diffstat (limited to 'src/org/codeaurora')
-rw-r--r--src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
index 8970ca8e8..3a94baec9 100644
--- a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
+++ b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
@@ -29,6 +29,7 @@
package org.codeaurora.snapcam.filter;
+import java.io.IOException;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayDeque;
@@ -65,6 +66,8 @@ import android.util.Log;
import android.view.Surface;
import com.android.camera.CaptureModule;
+import com.android.camera.Exif;
+import com.android.camera.exif.ExifInterface;
import com.android.camera.MediaSaveService;
import com.android.camera.MediaSaveService.OnMediaSavedListener;
import com.android.camera.PhotoModule.NamedImages;
@@ -821,11 +824,15 @@ public class ClearSightImageProcessor {
height = mClearSightImage.getHeight();
}
+ byte[] bayerBytes = getJpegData(mBayerImage);
+ ExifInterface exif = Exif.getExif(bayerBytes);
+ int orientation = Exif.getOrientation(exif);
+
mMediaSaveService.addMpoImage(
getJpegData(mClearSightImage),
- getJpegData(mBayerImage),
+ bayerBytes,
getJpegData(mMonoImage), width, height, title,
- date, null, 0, mMediaSavedListener,
+ date, null, orientation, mMediaSavedListener,
mMediaSaveService.getContentResolver(), "jpeg");
mBayerImage.close();