Fix shouldDecode check when image format is GIF

This commit is contained in:
zhongwuzw 2019-01-29 16:23:37 +08:00
parent 0e8dc82891
commit 05d3c7fdcb
1 changed files with 2 additions and 1 deletions

View File

@ -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;