...
|
...
|
@@ -47,6 +47,7 @@ |
|
|
cancelled:(SDWebImageNoParamsBlock)cancelBlock {
|
|
|
if ((self = [super init])) {
|
|
|
_request = request;
|
|
|
_shouldDecompressImages = YES;
|
|
|
_shouldUseCredentialStorage = YES;
|
|
|
_options = options;
|
|
|
_progressBlock = [progressBlock copy];
|
...
|
...
|
@@ -294,7 +295,12 @@ |
|
|
UIImage *image = [UIImage imageWithCGImage:partialImageRef scale:1 orientation:orientation];
|
|
|
NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL];
|
|
|
UIImage *scaledImage = [self scaledImageForKey:key image:image];
|
|
|
image = [UIImage decodedImageWithImage:scaledImage];
|
|
|
if (self.shouldDecompressImages) {
|
|
|
image = [UIImage decodedImageWithImage:scaledImage];
|
|
|
}
|
|
|
else {
|
|
|
image = scaledImage;
|
|
|
}
|
|
|
CGImageRelease(partialImageRef);
|
|
|
dispatch_main_sync_safe(^{
|
|
|
if (self.completedBlock) {
|
...
|
...
|
@@ -365,7 +371,9 @@ |
|
|
|
|
|
// Do not force decoding animated GIFs
|
|
|
if (!image.images) {
|
|
|
image = [UIImage decodedImageWithImage:image];
|
|
|
if (self.shouldDecompressImages) {
|
|
|
image = [UIImage decodedImageWithImage:image];
|
|
|
}
|
|
|
}
|
|
|
if (CGSizeEqualToSize(image.size, CGSizeZero)) {
|
|
|
completionBlock(nil, nil, [NSError errorWithDomain:@"SDWebImageErrorDomain" code:0 userInfo:@{NSLocalizedDescriptionKey : @"Downloaded image has 0 pixels"}], YES);
|
...
|
...
|
|