summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2013-08-22 16:07:31 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-08-22 16:07:31 -0700
commitd567d7d51fc84b9abb9bb5b3c6bf46855234a480 (patch)
treedcdaeea8b9800b4153ce9fab11a8d2c42985e4cb
parent0174828e574bc7c94c90be0dce7b3831983b0ff8 (diff)
parentce2acbcb77225b6d429a23e00f69aadde8c2378b (diff)
downloadandroid_packages_apps_Snap-d567d7d51fc84b9abb9bb5b3c6bf46855234a480.tar.gz
android_packages_apps_Snap-d567d7d51fc84b9abb9bb5b3c6bf46855234a480.tar.bz2
android_packages_apps_Snap-d567d7d51fc84b9abb9bb5b3c6bf46855234a480.zip
am ce2acbcb: Fix preview thumb orientation
* commit 'ce2acbcb77225b6d429a23e00f69aadde8c2378b': Fix preview thumb orientation
-rw-r--r--src/com/android/camera/PhotoModule.java5
-rw-r--r--src/com/android/camera/PhotoUI.java17
2 files changed, 15 insertions, 7 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 6098d01f3..bb486cb62 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -681,9 +681,6 @@ public class PhotoModule
}
if (mIsImageCaptureIntent) {
stopPreview();
- } else {
- // Animate capture with real jpeg data instead of a preview frame.
- mUI.animateCapture(jpegData);
}
if (mSceneMode == CameraUtil.SCENE_MODE_HDR) {
mUI.showSwitcher();
@@ -754,6 +751,8 @@ public class PhotoModule
jpegData, title, date, mLocation, width, height,
orientation, exif, mOnMediaSavedListener, mContentResolver);
}
+ // Animate capture with real jpeg data instead of a preview frame.
+ mUI.animateCapture(jpegData, orientation);
} else {
mJpegImageData = jpegData;
if (!mQuickCapture) {
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 6157d0f1d..7adb27f90 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -147,15 +147,24 @@ public class PhotoUI implements PieListener,
private class DecodeTask extends AsyncTask<Integer, Void, Bitmap> {
private final byte [] mData;
+ private int mOrientation;
- public DecodeTask(byte[] data) {
+ public DecodeTask(byte[] data, int orientation) {
mData = data;
+ mOrientation = orientation;
}
@Override
protected Bitmap doInBackground(Integer... params) {
// Decode image in background.
- return CameraUtil.downSample(mData, DOWN_SAMPLE_FACTOR);
+ Bitmap bitmap = CameraUtil.downSample(mData, DOWN_SAMPLE_FACTOR);
+ if (mOrientation != 0) {
+ Matrix m = new Matrix();
+ m.postRotate(mOrientation);
+ return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), m,
+ false);
+ }
+ return bitmap;
}
@Override
@@ -299,9 +308,9 @@ public class PhotoUI implements PieListener,
updateOnScreenIndicators(params, prefGroup, prefs);
}
- public void animateCapture(final byte[] jpegData) {
+ public void animateCapture(final byte[] jpegData, int orientation) {
// Decode jpeg byte array and then animate the jpeg
- DecodeTask task = new DecodeTask(jpegData);
+ DecodeTask task = new DecodeTask(jpegData, orientation);
task.execute();
}