我已經使用cordova plugin camera
在離子v1和角度v1。 當我們從相機拍攝照片時,插件本身爲裁剪圖像提供選項。但是從照片庫中選擇圖像沒有選項。離子圖像作物,同時從圖庫中選擇圖像
$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我猜..
任何人知道這個請幫忙嗎?
我已經嘗試過這種解決方案並獲得相機打開,而不是進行裁剪畫廊圖像。 –
@Hartarthipanchal嘗試一下我沒有爲畫廊進行測試,但它適用於相機裁剪。 – Pritish
我想你沒有得到我的問題。我已經明確提到,我想從圖片庫中選擇圖像的裁剪。 –