Open vrchvngel opened 2 years ago
I have same problem, don't know what happenned
I have the same issue, did you found the solution ?
As far I had tested, it should be an absolute path of the form of "file://...", for both platforms as well. So you should use a library able to open files from the phone filesystem.
It seems like this library is designed to work well with other libraries for reading files or opening files from photo gallery or with the camera, but I don't know if they think of the use case of bringing a file of a form of './assets/...' and other similar cases.
you need to add image picker first and then you can use it like that
try { ImageCropPicker.openPicker(gStyles.imgPicker).then(image => { PhotoEditor.open({ path: image.path, stickers: [ 'https://cdn-icons-png.flaticon.com/512/5272/5272912.png', 'https://cdn-icons-png.flaticon.com/512/5272/5272913.png', 'https://cdn-icons-png.flaticon.com/512/5272/5272916.png', ], }).then(result => { console.log('result', result); setFile({path: result}) }); }); } catch (error) {}
Hi, what should the path to the local file look like? It just works with web URL. I've tried:
const result = await PhotoEditor.open({ path: './assets/logo.png' });
and
const result = await PhotoEditor.open({ path: require('./assets/logo.png') });
and it doesn't work.