Please provide the following:
- SDK Version: 35.0.0
- Platforms(Android/iOS/web/all): Web
Looking at the api documentation for ImagePicker, I should get a result like this:
{
"cancelled":false,
"height":1611,
"width":2148,
"uri":"file:///data/user/0/host.exp.exponent/cache/cropped1814158652.jpg"
}
But when using Image Picker on the web and selecting an Image from Windows File Explorer, I get the following:
{
"cancelled":false,
"height":1611,
"width":2148,
"uri":"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABI..."
}
I always get the base64 string when I don’t add it as an option to the launchImageLibraryAsync() call. I’ve even tried adding the base64 option with it set to “false”, but I still end up with just the base64 string. Is this the expected behavior? The ImagePicker docs say the following: base64
is included if the base64
option was truthy.
This is the code I’m using to get the Image Picker result:
pickImage = async () => {
let result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.All,
allowsEditing: true,
aspect: [4, 3],
quality: 1
})
......
}
Thanks for any help!