summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-08-08 15:52:25 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-08-08 15:52:25 -0700
commit6a0ce1592b7c733c3d4c1449b494aa0868507208 (patch)
tree5deb59d7e18590fba50527c8a4d83f69ffdcf92f /src
parent152cef25710a1fd227a0943af485634aa5e1458e (diff)
parent804f10bf5909a2f6b53bfe4cd8549f913d30a738 (diff)
downloadandroid_packages_apps_Snap-6a0ce1592b7c733c3d4c1449b494aa0868507208.tar.gz
android_packages_apps_Snap-6a0ce1592b7c733c3d4c1449b494aa0868507208.tar.bz2
android_packages_apps_Snap-6a0ce1592b7c733c3d4c1449b494aa0868507208.zip
Merge "SnapdragonCamera: Provide correct orientation when adding image" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/CaptureModule.java17
-rw-r--r--src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java11
2 files changed, 23 insertions, 5 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;
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();