terrylinla / react-native-sketch-canvas

A React Native component for drawing by touching on both iOS and Android.
MIT License
692 stars 450 forks source link

localSourceImage not working #149

Open keung7251 opened 4 years ago

keung7251 commented 4 years ago

localSourceImage not working

let path = RNFS.DocumentDirectoryPath + images.filename; RNFS.writeFile(path, images.filename, 'utf8') .then((success) => { console.log('success', success);

       })
keung7251 commented 4 years ago

filename: filename, directory: RNFS.DocumentDirectoryPath , mode: 'AspectFit'

yestay90 commented 4 years ago

@keung7251 have you solved localSourceImage issue?

creambyemute commented 4 years ago

@yestay90 The typing of LocalSourceImage is wrong.

Instead of path, use filename

keung7251 commented 4 years ago

@yestay90 not yet

xyshirly commented 4 years ago

how did I solve it for android. 1.first, taking a picture by RNCamera(react-native-camera) and log the path of picture(bocz I dont know the right path) image image

2.load the image as background image in SketchCanvas image

finally, it works!😃

jahorwitz commented 4 years ago

Using this worked for me, thanks @xyshirly

localSourceImage={
     {
         filename: `${RNFS.DocumentDirectoryPath}/images/${imgName}`,
         mode: 'AspectFit'
     }
}

However, for some reason the image appears to be rotated 90 degrees counter-clockwise. Has anybody else seen this?

*Edit: Have confirmed, the changes made in this PR did fix the issue described above.

yestay90 commented 3 years ago

@jahorwitz , I am having problem when taking picture of text and setting it as localSouceImage. It is getting blur? DO you have such bug?

parsable-aberonja commented 3 years ago

Using this worked for me, thanks @xyshirly

localSourceImage={
     {
         filename: `${RNFS.DocumentDirectoryPath}/images/${imgName}`,
         mode: 'AspectFit'
     }
}

However, for some reason the image appears to be rotated 90 degrees counter-clockwise. Has anybody else seen this?

*Edit: Have confirmed, the changes made in this PR did fix the issue described above.

What happened with the rotation bug?