Skip to content

Commit eb91fdd

Browse files
committed
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
1 parent a8a69ab commit eb91fdd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

SDWebImage/SDWebImageDownloaderOperation.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#import "SDWebImageDecoder.h"
1111
#import "UIImage+MultiFormat.h"
1212
#import <ImageIO/ImageIO.h>
13+
#import "SDWebImageManager.h"
1314

1415
@interface SDWebImageDownloaderOperation () {
1516
BOOL _executing;
@@ -285,7 +286,8 @@ - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
285286

286287
if (partialImageRef) {
287288
UIImage *image = [UIImage imageWithCGImage:partialImageRef scale:1 orientation:orientation];
288-
UIImage *scaledImage = [self scaledImageForKey:self.request.URL.absoluteString image:image];
289+
NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL];
290+
UIImage *scaledImage = [self scaledImageForKey:key image:image];
289291
image = [UIImage decodedImageWithImage:scaledImage];
290292
CGImageRelease(partialImageRef);
291293
dispatch_main_sync_safe(^{
@@ -353,7 +355,8 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)aConnection {
353355

354356
UIImage *image = [UIImage sd_imageWithData:self.imageData];
355357

356-
image = [self scaledImageForKey:self.request.URL.absoluteString image:image];
358+
NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL];
359+
image = [self scaledImageForKey:key image:image];
357360

358361
if (!image.images) // Do not force decod animated GIFs
359362
{

0 commit comments

Comments
 (0)