From 05d3c7fdcbcd0277903a06ebaa10a06b494c4724 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Tue, 29 Jan 2019 16:23:37 +0800 Subject: [PATCH] Fix shouldDecode check when image format is GIF --- SDWebImage/SDWebImageDownloaderOperation.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index ae369997..83a074c3 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -10,6 +10,7 @@ #import "SDWebImageManager.h" #import "NSImage+WebCache.h" #import "SDWebImageCodersManager.h" +#import "UIImage+MultiFormat.h" #define LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); #define UNLOCK(lock) dispatch_semaphore_signal(lock); @@ -419,7 +420,7 @@ didReceiveResponse:(NSURLResponse *)response image = [self scaledImageForKey:key image:image]; // Do not force decoding animated images - BOOL shouldDecode = !image.images; + BOOL shouldDecode = !image.images && image.sd_imageFormat != SDImageFormatGIF; if (shouldDecode) { if (self.shouldDecompressImages) { BOOL shouldScaleDown = self.options & SDWebImageDownloaderScaleDownLargeImages;