var onSuccess = function(imageUri){
$scope.report.imgUri = imageUri;
};
var onError = function(message){
alert('Failed because: ' + message);
};
$scope.capturePhoto = function(){
navigator.camera.getPicture(onSuccess, onError, {
quality: 40,
destinationType: navigator.camera.DestinationType.FILE_URI,
correctOrientation: true,
saveToPhotoAlbum: true,
encodingType: navigator.camera.EncodingType.PNG,
targetWidth: divWidth
});
};
I am building Cordova 3.5.0 on Samsung S3 with Android 4.3. The camera.capturePhoto
function always ignore correctOrientation
set, so the pic did not rotate to correct orientation. But it works fine on HTC Butterfly with Android 4.4. BTW, encodingType
not work on android either. Any idea?
In some cases, setting navigator.camera.EncodingType.JPEG helped.
encodingType: Camera.EncodingType.JPEG,
mediaType: Camera.MediaType.PICTURE,
correctOrientation: true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With