4

I have a strange problem. I have some gif images in my project and some of them load and loop normally, others just loop once and stop. Any ideas why would this happen ? My dependencies:

compile 'com.facebook.fresco:animated-base-support:0.14.1'
compile 'com.facebook.fresco:animated-gif:0.14.1'

Updated to 1.0.0, but still the same outcome.

How i call the gif:

<Image source={require('./gif/Tree.gif')} />

Thank you !

React Native Version 0.45.1

TheNewbie
  • 323
  • 2
  • 9
  • 22
  • 1
    check these links: https://stackoverflow.com/questions/35594783/how-do-i-display-an-animated-gif-in-react-native https://stackoverflow.com/questions/38169519/how-to-display-gif-in-react-native-android-app – Jigar Shah Jun 28 '17 at 15:25
  • @JigarShah I did check them. I don't think I missed anything. Some of the GIFs are displaying and looping. While others loop once and then stay as a static Image. – TheNewbie Jun 28 '17 at 15:32
  • Change the code of node_modules/react-native/Libraries/Image/RCTGIFImageDecoder.m animation.repeatCount = loopCount == 0 ? HUGE_VALF : loopCount; to animation.repeatCount = loopCount == 0 ? 0 : loopCount; try this. – ER.SHASHI TIWARI Jun 28 '17 at 15:48
  • Hmm. now the app crashes just before the gif would be rendered. And by crash I mean hard crash. – TheNewbie Jun 28 '17 at 17:22
  • I fixed the crashing but the GIFs still do not loop. @ER.SHASHITIWARI – TheNewbie Jun 28 '17 at 18:15
  • I updated to fresco 1.0.0 , but still the same – TheNewbie Jun 28 '17 at 21:38
  • 3
    So you're saying some are looping and some are not? sounds like it's a problem with those gifs, not your app. Upload a gif [here](https://ezgif.com/loop-count) to change it's loop count and see if that helps (I believe 0 means infinite). – Dror Bar Dec 10 '18 at 15:56

0 Answers0