Flipboard / FLAnimatedImage

Performant animated GIF engine for iOS
MIT License
7.94k stars 1.22k forks source link

Automatic startAnimating causes request timeouts #190

Open afanslau opened 7 years ago

afanslau commented 7 years ago

I'm using FLAnimatedImageView in conjunction with SDWebImage, and when loading many gifs in a collection view, it starts downloading asynchronously, but only the first few images load successfully. I've verified that loading the images individually is fast, as well as when using non-animated images.

The issue seems to be related to FLAnimatedImageView automatically starting animating when the animatedImage property is set. When I comment out this startAnimating call in this method, everything loads correctly.

...

    // Start animating after the new animated image has been set.
    [self updateShouldAnimate];
    if (self.shouldAnimate) {
        [self startAnimating];
    }

} My guess is that when updating the frames of the gifs, it is somehow blocking the network requests from updating. I have a progress block set in the sd_setImageWIthUrl… method, but when the images start to fail, the progress block stops getting called.

If needed I can upload a sample project that reproduces the issue.