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

Unable to load source image from path in Android

Open zSergeant opened this issue 5 years ago • 3 comments

ImageResizer.createResizedImage(Platform.OS == 'IOS'?result.pathName:"file://"+result.pathName,200,110,"PNG",0)

"file://"+result.pathName => file:///storage/emulated/0/saved_signature/signature.png

error:Unable to load source image from path

zSergeant avatar May 09 '19 01:05 zSergeant

@zSergeant did you find the solution? I'm running into the same error. thx!

lelghrib avatar Apr 03 '20 15:04 lelghrib

Found the answer in an other issue, you have to use the base 64 of the image : const uri64 = await toBase64(uri); const image = 'data:image/jpeg;base64,' + uri64; ImageResizer.createResizedImage(image, newWidth, newHeight, 'JPEG', 100).then()

lelghrib avatar Apr 03 '20 15:04 lelghrib

Facing the same issue, Are you able to solve this issue? @zSergeant Any update on this? @PierreCapo @robertbarclay @JimTeva

Gopalakrishnan-V avatar Dec 05 '20 06:12 Gopalakrishnan-V

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 01 '22 18:09 stale[bot]

This issue has been automatically closed. Thank you for your contributions.

stale[bot] avatar Sep 08 '22 18:09 stale[bot]

We have 8k users on Pl@ntNet app having this issue on the last 2 weeks. We are not using the version 3 of the library though.

HugoGresse avatar Oct 03 '22 08:10 HugoGresse

An advice which worked in my case : try to read the file with fs.readFile(...) just before resizing. If readFile return an error you got your issue, your file don't exist

SaidKherif avatar Oct 26 '22 12:10 SaidKherif

@HugoGresse Did you find any work around?

ashokkumar88 avatar Feb 19 '23 07:02 ashokkumar88