As the title , How can I get the 'uri' of the image I selected?
When I use
CameraRoll.getPhotos()
and get result
[{
filename:"IMG_0005.JPG"
height:2002
isStored:true
uri:"assets-library://asset/asset.JPG?id=ED7AC36B-A150-4C38-BB8C-B6D696F4F2ED&ext=JPG"
width:3000
},
{
filename:"IMG_0004.JPG"
height:2500
isStored:true
uri:"assets-library://asset/asset.JPG?id=99D53A1F-FEEF-40E1-8BB3-7DD55A43C8B7&ext=JPG"
width:1668
}
....
]
check response object https://github.com/ivpusic/react-native-image-crop-picker#response-object
I checked the response object , but I can't find 'uri', doesn't it support that key?
@yongqianvip were you able to solve this ? The response object looks like this. I guess the PATH is how you show it ? But does it auto resize a large image ?

@ivpusic I am using this library and react-native-image-picker in a project. The path returned by this library isn't giving me an picture, but the uri returned by react-native-image-picker is working fine.Following is the comparison between path returned by this libe and uri returned by react-native-image-picker.
PATH --> /Users/shubhnik/Library/Developer/CoreSimulator/Devices/77A187E6-1181-4397-A4FC-85FBEE9F0F32/data/Containers/Data/Application/324F7179-62F5-444F-9C24-38575E634E05/tmp/react-native-image-crop-picker/A733F083-8650-4C7F-9288-DE10036DB106.jpg
URI --> file:///Users/shubhnik/Library/Developer/CoreSimulator/Devices/77A187E6-1181-4397-A4FC-85FBEE9F0F32/data/Containers/Data/Application/324F7179-62F5-444F-9C24-38575E634E05/Documents/6F5112FC-28EB-4A86-8609-8F6CD30CDB86.jpg
@ivpusic I don't know if its a normal thing or not, but when i use image.path in <Image source={{uri:image.path}} /> it works, but when i send it in formData than it doesn't works, the uri from the react-native-image-picker works in the formData. maybe you know of any workaround for this situation? Thanks for this awsm library though 😄
it should also work with formData. I am using it in my projects, and upload works without problem.
@ivpusic are you simply doing this formData.append('profilePic', image.path)? or other way ?
formdata.append('document', {
uri: XXX,
name: YYY
});
@ivpusic my bad, Thanks for your help, actually i was passing the formData as you mentioned in the other lib but not with this one, so that was an issue with my code. THANKS!!!!
@shubhnik could you find any solution for file path in this library? i use react-native-image-picker and works well , but i need crop image and i can not upload my image with this lib uri
Most helpful comment