Merge pull request #2520 from lhnoah/master

Optimize when scale = 1
This commit is contained in:
Bogdan Poplauschi 2018-10-30 10:02:52 +02:00 committed by GitHub
commit 3d62cfc507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -57,10 +57,12 @@ inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullabl
}
}
if (scale != image.scale) {
UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation];
scaledImage.sd_imageFormat = image.sd_imageFormat;
image = scaledImage;
}
}
return image;
}
#endif