0

I encountered some troubles when I used Image component like this

<Image style={{width: 50, height: 50}} source={{uri:'http://192.168.0.1/photos/photo.dng'}}/>

There are no any troubles DEBUG model. But if I change it to RELEASE model. It can't load pictures with DNG but JPG still be fine. I don't know how to solve it.

RichardSleet
  • 373
  • 4
  • 17

1 Answers1

2

.dng is not currently supported by Image

The currently supported formats are png, jpg, jpeg, bmp, gif, webp (Android only), psd (iOS only).

Why it worked when debugging

It may have worked while debugging if you had remote debugging enabled. When remote debugging with Chrome Dev Tools, Chrome will execute the javascript. Unfortunately, Chrome supports slightly different things than React Native.

alexdriedger
  • 2,884
  • 2
  • 23
  • 30
  • Thank you for your help! First thing I want to say is that The debug model is set in Xcode not Chrome Dev Tool.And I can show photo with dng extension by using native code.Finally do you have any way to solve the problem? THX. – RichardSleet Oct 15 '17 at 10:31
  • If there is native module that supports `.dng`, then you can write a native module for it. Here is the guide for [iOS](https://facebook.github.io/react-native/docs/native-modules-ios.html) and [Android](https://facebook.github.io/react-native/docs/native-modules-android.html) – alexdriedger Oct 15 '17 at 20:25