Images displaying only sometimes

Viewed 122

I have a React Native project app, created and managed through Expo. The app displays images fetched from our server.

I'm using the react-native <Image/> element to display the image from a URI, but sometimes the onError prop function is called with an error with the text 'unknown image format'. Otherwise it displays fine.

I am also calling Image.getSizeWithHeaders(), which results in an error for the same URIs that throw errors from the element.

All images are JPEG format, so I don't think it is a problem with different image formats.

If I send an XMLHttpRequest to the same URI, it responds the same way for the images that work and for those that don't.

I have tested the app on three devices; an iPhone loads all the images without issue, one Android device loads about 50%, and another (lower specced) device loads almost none. This indicates it could be an Android-specific issue.

I have confirmed that the images that throw errors do actually exist. The images are 1920 x 1072.

What possible causes are there for 'unknown image format' errors?
Could the issue be related to caching or limited memory?
Is there any other limitation of React Native Images that might be causing this?

0 Answers
Related