Crop

Improve this doc

$ ionic plugin add cordova-plugin-crop
$ npm install --save @ionic-native/crop

Repo: https://github.com/jeduan/cordova-plugin-crop

Crops images

Supported platforms

Usage

import {Crop} from '@ionic-native/crop';

constructor(private crop: Crop) { }

...

this.crop.crop('path/to/image.jpg', {quality: 75})
  .then(
    newImage => console.log("new image path is: " + newImage),
    error => console.error("Error cropping image", error)
  );

Instance Members

crop(pathToImage, options)

Crops an image

Param Type Details
pathToImage
options

Returns: Promise<string> Returns a promise that resolves with the new image path, or rejects if failed to crop.

API

Native

General