From 2c9deffdf2a84b83d451ee82f368744cc5218954 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Mon, 6 May 2024 15:25:57 +0800 Subject: [PATCH] Update the behavior for SDAnimatedImageView for animated image This should still be compatible for custom image class like YYPlugin --- SDWebImage/Core/SDAnimatedImageView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDWebImage/Core/SDAnimatedImageView.m b/SDWebImage/Core/SDAnimatedImageView.m index 5b719ff4..7e733672 100644 --- a/SDWebImage/Core/SDAnimatedImageView.m +++ b/SDWebImage/Core/SDAnimatedImageView.m @@ -129,12 +129,12 @@ // We need call super method to keep function. This will impliedly call `setNeedsDisplay`. But we have no way to avoid this when using animated image. So we call `setNeedsDisplay` again at the end. super.image = image; - if ([image.class conformsToProtocol:@protocol(SDAnimatedImage)]) { + if ([image.class conformsToProtocol:@protocol(SDAnimatedImage)] && [(id)image animatedImageFrameCount] > 1) { if (!self.player) { id provider; // Check progressive loading if (self.isProgressive) { - provider = [self progressiveAnimatedCoderForImage:image]; + provider = [(id)image animatedCoder]; } else { provider = (id)image; }