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/06/28 18:33:45 UTC
[5/8] android commit: Wire rotation fix to correctOrientation
parameter
Wire rotation fix to correctOrientation parameter
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/e2047afa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/e2047afa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/e2047afa
Branch: refs/heads/master
Commit: e2047afa426066b2764cfb3b1b0fa809abdc6f55
Parents: 231b39d
Author: macdonst <si...@gmail.com>
Authored: Wed Jun 27 15:32:26 2012 -0400
Committer: macdonst <si...@gmail.com>
Committed: Thu Jun 28 12:00:19 2012 -0400
----------------------------------------------------------------------
.../src/org/apache/cordova/CameraLauncher.java | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/e2047afa/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 4d21a9b..8b0c7b4 100755
--- a/framework/src/org/apache/cordova/CameraLauncher.java
+++ b/framework/src/org/apache/cordova/CameraLauncher.java
@@ -83,6 +83,7 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
private int encodingType; // Type of encoding to use
private int mediaType; // What type of media to retrieve
private boolean saveToPhotoAlbum; // Should the picture be saved to the device's photo album
+ private boolean correctOrientation; // Should the pictures orientation be corrected
public String callbackId;
private int numPics;
@@ -137,6 +138,7 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
this.targetHeight = args.getInt(4);
this.encodingType = args.getInt(5);
this.mediaType = args.getInt(6);
+ this.correctOrientation = args.getBoolean(8);
this.saveToPhotoAlbum = args.getBoolean(9);
if (srcType == CAMERA) {
@@ -281,7 +283,7 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
if (destType == DATA_URL) {
bitmap = getScaledBitmap(FileUtils.stripFileProtocol(imageUri.toString()));
- if (rotate != 0) {
+ if (rotate != 0 && this.correctOrientation) {
bitmap = getRotatedBitmap(rotate, bitmap, exif);
}
@@ -310,7 +312,7 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
} else {
bitmap = getScaledBitmap(FileUtils.stripFileProtocol(imageUri.toString()));
- if (rotate != 0) {
+ if (rotate != 0 && this.correctOrientation) {
bitmap = getRotatedBitmap(rotate, bitmap, exif);
}