From eb91fdd3b82bfce586c7d439224576dcc93e0a1c Mon Sep 17 00:00:00 2001 From: Bogdan Poplauschi Date: Thu, 19 Jun 2014 23:05:14 +0300 Subject: [PATCH] Fixed issue #529 - if the `cacheKeyFilter` was set, this was ignored when computing the `scaledImageForKey`. For most of the developers that did not set `cacheKeyFilter`, the code will work exactly the same --- SDWebImage/SDWebImageDownloaderOperation.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index a0b7db2f..b93be75a 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -10,6 +10,7 @@ #import "SDWebImageDecoder.h" #import "UIImage+MultiFormat.h" #import +#import "SDWebImageManager.h" @interface SDWebImageDownloaderOperation () { BOOL _executing; @@ -285,7 +286,8 @@ if (partialImageRef) { UIImage *image = [UIImage imageWithCGImage:partialImageRef scale:1 orientation:orientation]; - UIImage *scaledImage = [self scaledImageForKey:self.request.URL.absoluteString image:image]; + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; + UIImage *scaledImage = [self scaledImageForKey:key image:image]; image = [UIImage decodedImageWithImage:scaledImage]; CGImageRelease(partialImageRef); dispatch_main_sync_safe(^{ @@ -353,7 +355,8 @@ UIImage *image = [UIImage sd_imageWithData:self.imageData]; - image = [self scaledImageForKey:self.request.URL.absoluteString image:image]; + NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; + image = [self scaledImageForKey:key image:image]; if (!image.images) // Do not force decod animated GIFs {