我有以下代码。它基本上大部分都可以工作。我想要捕捉使用劣质相机的人,并警告他们的照片会很糟糕。(使用“cordova-plugin-camera”版本2.3.0)
var cameraOpts = {
quality: 100,
// destinationType: Camera.DestinationType.FILE_URI,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: $scope.sourceType,
allowEdit: false,
encodingType: Camera.EncodingType.JPEG,
// popoverOptions: CameraPopoverOptions,
targetWidth: 186,
targetHeight: 1024,
saveToPhotoAlbum: true,
correctOrientation: true
};
$cordovaCamera.getPicture(cameraOpts).then(function(imageData) {
var image = "data:image/jpeg;base64," + imageData;
$scope.setUpImage(index,image);
}, function(err) {
// error
$scope.showAlert('Warning!', 'Camera cancelled!');
});
任何想法都将不胜感激。 我正在寻找一种捕获低分辨率照片并向用户发送消息的方法。