Fix the `maxPixelSize` logic issue will cause a upscale in SDImageIOAnimatedCoder
This commit is contained in:
parent
fe92b7aa3d
commit
4332c29740
|
@ -468,7 +468,7 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
|
|||
NSUInteger pixelWidth = CGImageGetWidth(imageRef);
|
||||
NSUInteger pixelHeight = CGImageGetHeight(imageRef);
|
||||
CGFloat finalPixelSize = 0;
|
||||
if (maxPixelSize.width > 0 && maxPixelSize.height > 0 && pixelWidth > 0 && pixelHeight > 0) {
|
||||
if (maxPixelSize.width > 0 && maxPixelSize.height > 0 && pixelWidth > maxPixelSize.width && pixelHeight > maxPixelSize.height) {
|
||||
CGFloat pixelRatio = pixelWidth / pixelHeight;
|
||||
CGFloat maxPixelSizeRatio = maxPixelSize.width / maxPixelSize.height;
|
||||
if (pixelRatio > maxPixelSizeRatio) {
|
||||
|
|
Loading…
Reference in New Issue