question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't load network images in gl-react-expo package.

See original GitHub issue

feature request

Ability to load network images in gl-react-expo package.

The ExponentTextureLoader only supports loading using a RN module number. It doesn’t support other image sources such as remote or local/cached files using a format similar to { uri: 'https://...' } or { uri: 'file:///...' }

I’m guessing that you’ve already run into this issue since your cookbook-rn examples that use network images such as transitions use static images in the cookbook-expo version.

Is there a possible workaround for this? I’ve considered creating my own TextureLoader that loads an ImageSource. It would be exactly the same as the ExponentTextureLoader except this line. That logic would change to use Expo.Asset.fromModule(...) if the ImageSource is a number (the same as it already does) or construct an Expo.Asset manually if it is a network image. I would then use TextureLoaders to remove the ExponentTextureLoader and add my own. I haven’t tried this yet but if it works and you are okay with this solution, I’ll make a PR for the ExponentTextureLoader

library version

gl-react@3.0.0-alpha.6 gl-react-expo@3.0.0-alpha.6

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
grecommented, Apr 30, 2017

I’ve released a 3.1.0 that supports remote images by downloading them to a local asset. this is a temporary solution as EXGLView implementation will soon provide a nicer way to handle that 😃

0reactions
yedebacommented, Jun 4, 2018

Thank you. something new?, I can not load yet uri local value (file://data/data…) from camera. IOS work but not in android. 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

[expo-gl][Android][standalone] gl.texImage2D doesn't ... - GitHub
I've looked through RNs asset loading code at https://github.com/facebook/react-native/blob/master/Libraries/Image/AssetSourceResolver.js but haven't been able ...
Read more >
GLView - Expo Documentation
GLView. expo-gl provides a View that acts as an OpenGL ES render target, useful for rendering 2D and 3D graphics. On mounting, an...
Read more >
I can't upload a image from Android in expo - Stack Overflow
It's expo(react native) project and I ...
Read more >
How to use the expo-asset-utils.resolveAsync function ... - Snyk
resolveAsync(asset); function parseAsset(image) { texture.image = image; // JPEGs can't have an alpha channel, so memory can be saved by storing them as ......
Read more >
expo failed to resolve plugin for module - You.com
Hi, just looking for some support as I am new to using config plugins and I can't figure out why I can't install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found