summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CaptureModule.java
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-07-25 18:16:26 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-07-26 17:23:57 -0700
commit804f10bf5909a2f6b53bfe4cd8549f913d30a738 (patch)
tree015376d16b63f37cecc77628b8e22b56cfcbc88c /src/com/android/camera/CaptureModule.java
parent42a76b8f08b6b328b9d6bd0b235679ded161fbc6 (diff)
downloadandroid_packages_apps_Snap-804f10bf5909a2f6b53bfe4cd8549f913d30a738.tar.gz
android_packages_apps_Snap-804f10bf5909a2f6b53bfe4cd8549f913d30a738.tar.bz2
android_packages_apps_Snap-804f10bf5909a2f6b53bfe4cd8549f913d30a738.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/com/android/camera/CaptureModule.java')
-rw-r--r--src/com/android/camera/CaptureModule.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index aeda2dfa6..4edf3ab9e 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -72,6 +72,8 @@ import android.view.SurfaceView;
import android.view.View;
import android.widget.Toast;
+import com.android.camera.exif.ExifInterface;
+import com.android.camera.Exif;
import com.android.camera.imageprocessor.filter.ImageFilter;
import com.android.camera.imageprocessor.PostProcessor;
import com.android.camera.imageprocessor.FrameProcessor;
@@ -1287,8 +1289,11 @@ public class CaptureModule implements CameraModule, PhotoController,
byte[] bytes = getJpegData(image);
mLastJpegData = bytes;
+ ExifInterface exif = Exif.getExif(bytes);
+ int orientation = Exif.getOrientation(exif);
+
mActivity.getMediaSaveService().addImage(bytes, title, date,
- null, image.getWidth(), image.getHeight(), 0, null,
+ null, image.getWidth(), image.getHeight(), orientation, null,
mOnMediaSavedListener, mContentResolver, "jpeg");
image.close();
}
@@ -1327,8 +1332,11 @@ public class CaptureModule implements CameraModule, PhotoController,
mLastJpegData = bytes;
buffer.get(bytes);
+ ExifInterface exif = Exif.getExif(bytes);
+ int orientation = Exif.getOrientation(exif);
+
mActivity.getMediaSaveService().addImage(bytes, title, date,
- null, image.getWidth(), image.getHeight(), 0, null,
+ null, image.getWidth(), image.getHeight(), orientation, null,
mOnMediaSavedListener, mContentResolver, "jpeg");
image.close();
}
@@ -3222,9 +3230,12 @@ public class CaptureModule implements CameraModule, PhotoController,
byte[] monoBytes = getJpegData(monoImage);
mLastJpegData = bayerBytes;
+ ExifInterface exif = Exif.getExif(bayerBytes);
+ int orientation = Exif.getOrientation(exif);
+
mActivity.getMediaSaveService().addMpoImage(
null, bayerBytes, monoBytes, width, height, title,
- date, null, 0, mOnMediaSavedListener, mContentResolver, "jpeg");
+ date, null, orientation, mOnMediaSavedListener, mContentResolver, "jpeg");
bayerImage.close();
bayerImage = null;