Fix the hardcode to filter WebP for force decoding

This commit is contained in:
DreamPiggy 2019-01-17 18:21:11 +08:00
parent c804ba7ea8
commit f9fe2bb7b6
1 changed files with 2 additions and 13 deletions

View File

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