【发布时间】:2017-11-02 14:29:34
【问题描述】:
我在 ionic v1 和 angular v1 中使用过cordova plugin camera。
当我们从相机拍照时,插件本身提供了裁剪图像的选项..但是从照片库中选择图像没有选项。
$scope.choosePhoto = function () {
var options = {
quality: 75,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 200,
targetHeight: 200,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: true
};
$cordovaCamera.getPicture(options).then(function (imageData) {
$scope.imgURI = "data:image/jpeg;base64," + imageData;
window.localStorage.setItem('image',($scope.imgURI));
}, function (err) {
// An error occured. Show a message to the user
});
}
在选择图库图像时是否有任何图像裁剪解决方案..
对于我的项目,我也为此使用cordova plugin crop..
有一个选项,例如,
plugins.crop.promise('/path/to/image', options)
.then(function success (newPath) {
})
.catch(function fail (err) {
})
但它不起作用,我猜它只适用于android..
谁知道这件事请帮忙?
【问题讨论】: