react-native-image-editor icon indicating copy to clipboard operation
react-native-image-editor copied to clipboard

Requested column: 0, # of columns: 0

Open Anujmoglix opened this issue 4 years ago • 2 comments

Getting this with 'react-native-image-picker';

Anujmoglix avatar Jun 07 '20 09:06 Anujmoglix

Same error

AdeilsonESilva avatar Jun 12 '20 15:06 AdeilsonESilva

I've workaround the issue by using path instead of uri given from react-native-image-picker as follow:

   ImagePicker.showImagePicker(options, (response) => {
      if (response.error) {
        Alert.alert(response.error)
      } else {
        ... 
        const fileUri = Platform.OS === 'android' ? `file://${response.path}` : response.uri
        const thumbnailUri = await ImageEditor.cropImage(
          fileUri,
          cropData,
        )
        ...
      }
    })

m4r00p avatar Jul 07 '20 11:07 m4r00p

This library is compatible with the latest react-native-image-picker version

an example of usage

import {launchImageLibrary} from 'react-native-image-picker';
import ImageEditor from '@react-native-community/image-editor';

async function cropImage(){
  const response = await launchImageLibrary({ mediaType: 'photo', includeExtra: true });
  const uri = response.assets?.[0]?.uri;
  if(uri){
    const cropResult = await ImageEditor.cropImage(uri, {...});
    console.log(cropResult);
  }
}

retyui avatar Feb 25 '24 13:02 retyui