Image Editor Native module for React Native.
yarn add @react-native-community/image-editor
npm install @react-native-community/image-editor --save
react-native link @react-native-community/image-editor
Start by importing the library:
Crop the image specified by the URI param. If URI points to a remote image, it will be downloaded automatically. If the image cannot be loaded/downloaded, the promise will be rejected.
If the cropping process is successful, the resultant cropped image will be stored in the cache path, and the URI returned in the promise will point to the image in the cache path. Remember to delete the cropped image from the cache path when you are done with it.
||Yes||The top-left corner of the cropped image, specified in the original image's coordinate space|
||Yes||Size (dimensions) of the cropped image|
||No||Size to which you want to scale the cropped image|
||No||Resizing mode to use when scaling the image (iOS only, android resize mode is always 'cover') Default value: 'contain'|
cropData =offset: x: number y: numbersize: width: number height: numberdisplaySize: width: number height: numberresizeMode: 'contain' | 'cover' | 'stretch';
For more advanced usage check our example app.