Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Load image from device #33

Closed
mushroomgenie opened this issue Nov 10, 2020 · 5 comments · Fixed by gre/webgltexture-loader#21
Closed

How to Load image from device #33

mushroomgenie opened this issue Nov 10, 2020 · 5 comments · Fixed by gre/webgltexture-loader#21

Comments

@mushroomgenie
Copy link

mushroomgenie commented Nov 10, 2020

<GLImage source={{uri:"https://i.imgur.com/uTP9Xfr.jpg"}} resizeMode="contain"/> this works perfectly fine.
But
<GLImage source={{uri:"file://..."}} resizeMode="contain"/> this renders nothing. I have tried using resolveAssetSource but no luck there as well.
@gre Help would be really appreciated. Thank You

@mistikk
Copy link

mistikk commented Nov 16, 2020

same issue

@bwoodlt
Copy link

bwoodlt commented Dec 26, 2020

Having the same issue...

@mushroomgenie
Copy link
Author

Any update on this ? @gre

@emrahtoy
Copy link

emrahtoy commented Feb 26, 2021

I have been dealing the same problem. Usual <Image> works with the original uri but <GLImage> doesn't work ( i picked the uri by using expo mediaLibrary ).

It seems like encoding problem but may also related with the async process problem.

I have solved my problem with using FileSystem of expo instead of relying on GLImage uri process.

Here is the code;

FileSystem.getInfoAsync(image!).then(info => { console.log(info) this.setState({ image: info.uri}); }).catch(e => console.log(e));

Here, image variable is the current uri of the image ( taken by mediaLibrary ) . After all FileSystem gathers the info, i set the image variable with the info.uri ( which has slightly different encoding then original uri ) and i used it with <GLImage source={{uri: this.state.image}}></GLImage>

Note : @gre this might be happening due to that expo depreciated expo-assets

@gre
Copy link
Owner

gre commented May 31, 2022

Can you confirm this is now fixed in this upcoming version? Thanks

 - gl-react-dom => 5.2.2-next.6+d39872d
 - gl-react-expo => 5.2.2-next.6+d39872d
 - gl-react-headless => 5.2.2-next.6+d39872d
 - gl-react-native => 5.2.2-next.6+d39872d
 - gl-react => 5.2.2-next.6+d39872d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants