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

This commit is contained in:
Bogdan Poplauschi 2014-06-19 23:05:14 +03:00
parent a8a69ab9b6
commit eb91fdd3b8
1 changed files with 5 additions and 2 deletions

View File

@ -10,6 +10,7 @@
#import "SDWebImageDecoder.h"
#import "UIImage+MultiFormat.h"
#import <ImageIO/ImageIO.h>
#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
{