Merge pull request #32 from SDWebImage/fix_thumbnail_progressive_size
Fix the issue that thumbnail decoding does not works for progressive webp image
This commit is contained in:
commit
11e4f1a973
|
@ -362,6 +362,13 @@ static CGSize SDCalculateThumbnailSize(CGSize fullSize, BOOL preserveAspectRatio
|
||||||
scale = 1;
|
scale = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CGSize scaledSize = SDCalculateThumbnailSize(CGSizeMake(width, height), _preserveAspectRatio, _thumbnailSize);
|
||||||
|
// Check whether we need to use thumbnail
|
||||||
|
if (!CGSizeEqualToSize(CGSizeMake(width, height), scaledSize)) {
|
||||||
|
CGImageRef scaledImageRef = [SDImageCoderHelper CGImageCreateScaled:newImageRef size:scaledSize];
|
||||||
|
CGImageRelease(newImageRef);
|
||||||
|
newImageRef = scaledImageRef;
|
||||||
|
}
|
||||||
|
|
||||||
#if SD_UIKIT || SD_WATCH
|
#if SD_UIKIT || SD_WATCH
|
||||||
image = [[UIImage alloc] initWithCGImage:newImageRef scale:scale orientation:UIImageOrientationUp];
|
image = [[UIImage alloc] initWithCGImage:newImageRef scale:scale orientation:UIImageOrientationUp];
|
||||||
|
|
Loading…
Reference in New Issue