Fix the hardcode to filter WebP for force decoding
This commit is contained in:
parent
c804ba7ea8
commit
f9fe2bb7b6
|
@ -419,19 +419,8 @@ didReceiveResponse:(NSURLResponse *)response
|
||||||
NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL];
|
NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL];
|
||||||
image = [self scaledImageForKey:key image:image];
|
image = [self scaledImageForKey:key image:image];
|
||||||
|
|
||||||
BOOL shouldDecode = YES;
|
// Do not force decoding animated images
|
||||||
// Do not force decoding animated GIFs and WebPs
|
BOOL shouldDecode = !image.images;
|
||||||
if (image.images) {
|
|
||||||
shouldDecode = NO;
|
|
||||||
} else {
|
|
||||||
#ifdef SD_WEBP
|
|
||||||
SDImageFormat imageFormat = [NSData sd_imageFormatForImageData:imageData];
|
|
||||||
if (imageFormat == SDImageFormatWebP) {
|
|
||||||
shouldDecode = NO;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shouldDecode) {
|
if (shouldDecode) {
|
||||||
if (self.shouldDecompressImages) {
|
if (self.shouldDecompressImages) {
|
||||||
BOOL shouldScaleDown = self.options & SDWebImageDownloaderScaleDownLargeImages;
|
BOOL shouldScaleDown = self.options & SDWebImageDownloaderScaleDownLargeImages;
|
||||||
|
|
Loading…
Reference in New Issue