You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2012/07/05 22:05:14 UTC
android commit: CB-999: When getting images from the PHOTOLIBRARY
apply the correctOrientation fix
Updated Branches:
refs/heads/master 14870726e -> 1f46240ba
CB-999: When getting images from the PHOTOLIBRARY apply the correctOrientation fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/1f46240b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/1f46240b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/1f46240b
Branch: refs/heads/master
Commit: 1f46240ba9d26de6602a19364e1cd207a52c3293
Parents: 1487072
Author: macdonst <si...@gmail.com>
Authored: Thu Jul 5 16:04:47 2012 -0400
Committer: macdonst <si...@gmail.com>
Committed: Thu Jul 5 16:04:47 2012 -0400
----------------------------------------------------------------------
.../src/org/apache/cordova/CameraLauncher.java | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/1f46240b/framework/src/org/apache/cordova/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CameraLauncher.java b/framework/src/org/apache/cordova/CameraLauncher.java
index 3251bb3..fa19ca3 100755
--- a/framework/src/org/apache/cordova/CameraLauncher.java
+++ b/framework/src/org/apache/cordova/CameraLauncher.java
@@ -375,12 +375,10 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
String imagePath = FileUtils.getRealPathFromURI(uri, this.cordova);
Bitmap bitmap = getScaledBitmap(imagePath);
- // If sending base64 image back
- if (destType == DATA_URL) {
+ if (this.correctOrientation) {
String[] cols = { MediaStore.Images.Media.ORIENTATION };
Cursor cursor = this.cordova.getActivity().getContentResolver().query(intent.getData(),
- cols,
- null, null, null);
+ cols, null, null, null);
if (cursor != null) {
cursor.moveToPosition(0);
rotate = cursor.getInt(0);
@@ -391,6 +389,10 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
matrix.setRotate(rotate);
bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
}
+ }
+
+ // If sending base64 image back
+ if (destType == DATA_URL) {
this.processPicture(bitmap);
}