0

I'm trying to load these specific images using the following uri: https://image.tmdb.org/t/p/w500/zkXnKIwX5pYorKJp2fjFSfNyKT0.jpg https://image.tmdb.org/t/p/w500/bbxtz5V0vvnTDA2qWbiiRC77Ok9.jpg

The onError event throws the following error: Error decoding image data

The images loads correctly in safari and chrome. Any ideas what could be wrong? How can I debug this furthur? Other Images are loading correctly, but these specific images throws these error.

RN 0.41 Platform: iOS

Salman Hasrat Khan
  • 1,971
  • 1
  • 20
  • 27
  • Even though these images have .jpg suffix, they may actually have some other format that we are not aware of. You can think of my theory as someone changed gif file by renaming it with png suffix. From the surface it may be a png or jpg but Image wont load it in Android. It actually happened to me once. – eden Mar 02 '17 at 17:43
  • Have you tried http versions? – berkayk Mar 02 '17 at 18:16
  • @EnieJakiro that what I suspect. But how can I debug and confirm this? – Salman Hasrat Khan Mar 03 '17 at 04:09
  • @berkayk I haven't tried that yet but I don't think this is related to https – Salman Hasrat Khan Mar 03 '17 at 04:09
  • @SalmanHasratKhan download images yourself and use locally. If they show up we can see thats a network issue, else file is corrupted, so you may need middleware file handling or fixing the image and uploading to your own servers – eden Mar 03 '17 at 04:53
  • @EnieJakiro Interestingly it works when I download and require it locally. Also I've just noticed that this problem is only in the simulator but works fine on the device. What else can we do to debug this further? – Salman Hasrat Khan Mar 03 '17 at 07:22
  • You may kill your packager and run it again with react-native start. Also debugging through android studio (or react-native log-android) may reveal some native errors, since simulators sometimes don't have every required file bundled with them. Also you may choose a different sdk and try rebuild – eden Mar 03 '17 at 07:29
  • @EnieJakiro I tried killing the packager and restarting but t didn't help. I don't have much experience with Android Studio. I'll try a different device maybe – Salman Hasrat Khan Mar 03 '17 at 07:33
  • Just open Android Studio when you're connected to your simulator. Logs will show. – eden Mar 03 '17 at 07:34
  • @SalmanHasratKhan updates? – eden Mar 05 '17 at 21:23

1 Answers1

-2

download the images and use them in requie("//address of the image in your project")

  • 4
    Please add more explanation to your answer, to be more understandable – mastisa Aug 20 '18 at 06:23
  • download the images and save them into your project for example save it in "MyApp/app/images",then in the image source do like this: source={require('./../../images/name_of_the_image.png')} – Mojtaba Moshfeghi far Aug 21 '18 at 05:34