guhungry / react-native-photo-manipulator

React Native Image Processing API to edit photo programmatically for Android and iOS. It features print text, overlay on another image (add watermark), resize, crop, flip, rotate and optimize image size then convert file format to jpeg or png
MIT License
338 stars 38 forks source link

Can't find variable PhotoManipulator #323

Closed master-css closed 3 years ago

master-css commented 3 years ago

My app is showing error like "Can't find variable PhotoManipulator" how can i solve this error i am new in React-native so i' dont have a much more knowledge about this

This is my code :::::::::

import React from 'react'; import { SafeAreaView, StyleSheet, ScrollView, View, Text, Image,ImageBackground } from 'react-native'; import RNPhotoManipulator from 'react-native-photo-manipulator';

const image = "https://unsplash.com/photos/qw6qQQyYQpo/download?force=true"; const cropRegion = { x: 5, y: 30, height: 400, width: 250 }; const targetSize = { size: 200, width: 150 };

const Img=()=>{ PhotoManipulator.crop(image, cropRegion, targetSize).then(path => { console.log(Result image path: ${path}); });

return (

okk
);

}

class App extends React.Component {

render(){

return ( 
  <View>
  <Text>Jenil Chavda</Text>
  <Img/>
  </View>

);

} }

export default React.memo(App);

const styles = StyleSheet.create(
{

container: { flex: 1, backgroundColor: '#FBFCFC', //#FFFAFA

flexDirection: 'column',alignItems: 'center',alignSelf: 'stretch', justifyContent:'space-around',

}, });

master-css commented 3 years ago

I solved this issue by using RNPhotoManipulator instead of PhotoManipulator