SDWebImage+WebP ImageView flicker when app Re-enter foreground
Asked Answered
M

1

7

I am facing issue on SDWebImage+WebP integration in our project via CocoaPods. I am using SDWebImage+WebP to load my webp images from my server in list of collection in UItableView.

Every time I re-enter foreground or on every relaunch imageView in cell will re-fetch images from disk(mean while image view will be blank) and reload UIImageview with same image, even though data haven't changed on server.

But When I used JPG format with the same code base it will work as I expected, there is no black out on re-enter foreground it will shows the cached images. But it does not work with webp

Code I used :

[videoV.imageViewVideo sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:nil options:SDWebImageRefreshCached|SDWebImageRetryFailed ];

Any help appreciate!

Muimuir answered 22/2, 2018 at 8:9 Comment(0)
D
0

I'm using a workaround. It may cause problem that image cache can't be refresh.

check the image url if it's the same with current image. if so, don't call setImage.

guard self.kf.webURL != url || self.image == placeholder || self.image == nil
Devinne answered 22/1, 2019 at 10:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.