Merge pull request #2606 from zhongwuzw/fix_disable_animated_images_decompress
Fix shouldDecode check when image format is GIF
This commit is contained in:
commit
bb9e4a1b09
|
@ -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);
|
||||
|
@ -418,8 +419,9 @@ didReceiveResponse:(NSURLResponse *)response
|
|||
NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL];
|
||||
image = [self scaledImageForKey:key image:image];
|
||||
|
||||
// Do not force decoding animated images
|
||||
BOOL shouldDecode = !image.images;
|
||||
// Do not force decoding animated images or GIF,
|
||||
// because there has imageCoder which can change `image` or `imageData` to static image, lose the animated feature totally.
|
||||
BOOL shouldDecode = !image.images && image.sd_imageFormat != SDImageFormatGIF;
|
||||
if (shouldDecode) {
|
||||
if (self.shouldDecompressImages) {
|
||||
BOOL shouldScaleDown = self.options & SDWebImageDownloaderScaleDownLargeImages;
|
||||
|
|
Loading…
Reference in New Issue