From 4d354c4acdc0ba8e3db1af8fc687a8bf450a46ee Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Wed, 12 Feb 2020 12:13:04 +0800 Subject: [PATCH] Make the SDAniamtedImage response to the UIImage+Metadata category method, which should return the status matching the behavior --- SDWebImage/Core/SDAnimatedImage.m | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/SDWebImage/Core/SDAnimatedImage.m b/SDWebImage/Core/SDAnimatedImage.m index ce5d5d29..d27e2c4b 100644 --- a/SDWebImage/Core/SDAnimatedImage.m +++ b/SDWebImage/Core/SDAnimatedImage.m @@ -12,6 +12,7 @@ #import "SDImageCodersManager.h" #import "SDImageFrame.h" #import "UIImage+MemoryCacheCost.h" +#import "UIImage+Metadata.h" #import "SDImageAssetManager.h" #import "objc/runtime.h" @@ -298,3 +299,31 @@ static CGFloat SDImageScaleFromPath(NSString *string) { } @end + +@implementation SDAnimatedImage (Metadata) + +- (BOOL)sd_isAnimated { + return YES; +} + +- (NSUInteger)sd_imageLoopCount { + return self.animatedImageLoopCount; +} + +- (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount { + return; +} + +- (SDImageFormat)sd_imageFormat { + return self.animatedImageFormat; +} + +- (void)setSd_imageFormat:(SDImageFormat)sd_imageFormat { + return; +} + +- (BOOL)sd_isVector { + return NO; +} + +@end