From f9fe2bb7b625635da96da673caa4a58202221997 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Thu, 17 Jan 2019 18:21:11 +0800 Subject: [PATCH] Fix the hardcode to filter WebP for force decoding --- SDWebImage/SDWebImageDownloaderOperation.m | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index 34d701b0..a4b38ee0 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -419,19 +419,8 @@ didReceiveResponse:(NSURLResponse *)response NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; image = [self scaledImageForKey:key image:image]; - BOOL shouldDecode = YES; - // Do not force decoding animated GIFs and WebPs - if (image.images) { - shouldDecode = NO; - } else { -#ifdef SD_WEBP - SDImageFormat imageFormat = [NSData sd_imageFormatForImageData:imageData]; - if (imageFormat == SDImageFormatWebP) { - shouldDecode = NO; - } -#endif - } - + // Do not force decoding animated images + BOOL shouldDecode = !image.images; if (shouldDecode) { if (self.shouldDecompressImages) { BOOL shouldScaleDown = self.options & SDWebImageDownloaderScaleDownLargeImages;