callstack / react-native-image-editor

A library providing an API for cropping images from the web and the local file system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read property 'cropImage' of undefined

dungnguyentri3110 opened this issue · comments

Question

Hello, i just install ImageEditor and use it to crop my image. But when i do this action, have warning like this "Cannot read property 'cropImage' of undefined".
This is my code
const cropData = {
offset:{x: 0, y: 0},
size: {width: image.width, height: image.height},
displaySize: {width: image.width, height: image.height},
resizeMode: 'contain'
}

  ImageEditor.cropImage(image.uri, cropData).then(url =>{
    console.log(`LIST ITEM SELECT`, url);
  }).catch(error =>{
    console.log(`ERROR`, error);
  })