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
});
};
嗨伙计们,我正在使用Android 4.3在Samsung S3上构建Cordova 3.5.0. camera.capturePhoto函数始终忽略correctOrientation设置,因此pic没有旋转到正确的方向.但它适用于Android 4.4的HTC Butterfly. BTW,encodingType也不适用于android.任何理想?
最佳答案
在某些情况下,设置navigator.camera.EncodingType.JPEG会有所帮助.
encodingType: Camera.EncodingType.JPEG,mediaType: Camera.MediaType.PICTURE,correctOrientation: true