Crop an image in a Ionic/Cordova app
& cordova plugin add https://github.com/Riyaz0001/cordova-plugin-image-cropper.git
& ionic cordova plugin add https://github.com/Riyaz0001/cordova-plugin-image-cropper.git
NOTE: Make sure your Cordova CLI version is 5.0.0+ (check with cordova -v). Cordova 4.x and below uses the now deprecated Cordova Plugin Registry as its plugin repository, so using a version of Cordova 4.x or below will result in installing an old version of this plugin.
// callback function
ImageCropper.cropImage(imgUrl,
// success callback
function (imgPath) {
// saved cropted image path
console.log(imgPath);
// error callback
}, function (err) { console.error(err); });
// callback function
(<any>window).ImageCropper.cropImage(imgUrl,
// success callback
function (imgPath) {
// saved cropted image path
console.log(imgPath);
// error callback
}, function (err) { console.error(err); });
- Android: Android-Image-Cropper
MIT © Riyaz