Skip to content

Commit

Permalink
Fixed issue #529 - if the cacheKeyFilter was set, this was ignored …
Browse files Browse the repository at this point in the history
…when computing the `scaledImageForKey`. For most of the developers that did not set `cacheKeyFilter`, the code will work exactly the same
  • Loading branch information
bpoplauschi committed Jun 19, 2014
1 parent a8a69ab commit eb91fdd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions SDWebImage/SDWebImageDownloaderOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "SDWebImageDecoder.h"
#import "UIImage+MultiFormat.h"
#import <ImageIO/ImageIO.h>
#import "SDWebImageManager.h"

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

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(^{
Expand Down Expand Up @@ -353,7 +355,8 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)aConnection {

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
{
Expand Down

0 comments on commit eb91fdd

Please sign in to comment.