forked from github/cordova-android
Wire rotation fix to correctOrientation parameter
This commit is contained in:
parent
231b39d2dc
commit
e2047afa42
@ -83,6 +83,7 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
|
|||||||
private int encodingType; // Type of encoding to use
|
private int encodingType; // Type of encoding to use
|
||||||
private int mediaType; // What type of media to retrieve
|
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 saveToPhotoAlbum; // Should the picture be saved to the device's photo album
|
||||||
|
private boolean correctOrientation; // Should the pictures orientation be corrected
|
||||||
|
|
||||||
public String callbackId;
|
public String callbackId;
|
||||||
private int numPics;
|
private int numPics;
|
||||||
@ -137,6 +138,7 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
|
|||||||
this.targetHeight = args.getInt(4);
|
this.targetHeight = args.getInt(4);
|
||||||
this.encodingType = args.getInt(5);
|
this.encodingType = args.getInt(5);
|
||||||
this.mediaType = args.getInt(6);
|
this.mediaType = args.getInt(6);
|
||||||
|
this.correctOrientation = args.getBoolean(8);
|
||||||
this.saveToPhotoAlbum = args.getBoolean(9);
|
this.saveToPhotoAlbum = args.getBoolean(9);
|
||||||
|
|
||||||
if (srcType == CAMERA) {
|
if (srcType == CAMERA) {
|
||||||
@ -281,7 +283,7 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
|
|||||||
if (destType == DATA_URL) {
|
if (destType == DATA_URL) {
|
||||||
bitmap = getScaledBitmap(FileUtils.stripFileProtocol(imageUri.toString()));
|
bitmap = getScaledBitmap(FileUtils.stripFileProtocol(imageUri.toString()));
|
||||||
|
|
||||||
if (rotate != 0) {
|
if (rotate != 0 && this.correctOrientation) {
|
||||||
bitmap = getRotatedBitmap(rotate, bitmap, exif);
|
bitmap = getRotatedBitmap(rotate, bitmap, exif);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +312,7 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
|
|||||||
} else {
|
} else {
|
||||||
bitmap = getScaledBitmap(FileUtils.stripFileProtocol(imageUri.toString()));
|
bitmap = getScaledBitmap(FileUtils.stripFileProtocol(imageUri.toString()));
|
||||||
|
|
||||||
if (rotate != 0) {
|
if (rotate != 0 && this.correctOrientation) {
|
||||||
bitmap = getRotatedBitmap(rotate, bitmap, exif);
|
bitmap = getRotatedBitmap(rotate, bitmap, exif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user