GLImage not working with image from ImagePicker.launchImageLibraryAsync

Please provide the following:

  1. SDK Version: 3.21.3
  2. Platforms(Android/iOS/web/all): Android


I’m trying to build an app that displays an image chosen from the device gallery (Android). To display the image I’m using a GLImage component from gl-react-image

This works:

<GLImage source={{ uri: “” }} resizeMode=“contain” />

But when I try to do

this.setState({ photo: await ImagePicker.launchCameraAsync({}) });

This doesn’t work anymore

<GLImage source={{ uri: photo.uri }} resizeMode=“contain” />

With the error message “EXGL: Invailid pixel data argument for gl.texImageData2D”

photo.uri is a local file and looks like this:


Do I have to resolve this local file URI to a different kind of URI?

What am I doing wrong?


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.