meliorence / react-native-image-gallery

Pure JavaScript image gallery component for iOS and Android with high-performance and native feeling in mind

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to show a base64 image?

KennethTavares opened this issue · comments

Does this component support images in the base64 format?
In my project this error happened when I downloaded the json string

ReactNativeJS: 'react-native-image-gallery', 'Please provide dimensions of your local images'

thanks a lot!

Anybody know?

You should use:
{ source: { uri: 'base64 ' }, dimensions: { width: 1920, height: 1080 }, } besides the source you must pass the dimension.

I pass the dimensions and it still gives me this warning and it doesn't upload any image. Does anybody knows why?

An example to one of the images in my array:
{source: {url: 'https://lh3.googleusercontent.com/p/AF1QipMJki5Im_7IIwBhRVCzfYkwP7zNdCZm0y9qyK3l=s1600-w400-h250' }, dimensions: { width: 400, height: 250 } }

When I insert the images manually in an array, they are shown. But when I add the images to the array through my fetch method, it displays this warning. Although when I print the content of each array, they are the same.

I noticed that you are using url instead of uri, change to: { source: { uri: 'https://lh3.googleusercontent.com/p/AF1QipMJki5Im_7IIwBhRVCzfYkwP7zNdCZm0y9qyK3l=s1600-w400-h250 ' }, dimensions: { width: 400, height: 250 }, }

I noticed that you are using url instead of uri, change to: { source: { uri: 'https://lh3.googleusercontent.com/p/AF1QipMJki5Im_7IIwBhRVCzfYkwP7zNdCZm0y9qyK3l=s1600-w400-h250 ' }, dimensions: { width: 400, height: 250 }, }

Thank you for your reply. I changed it to "uri" but it is still asking me to provide dimensions.

anyone solved? i stack here