Take images into account

This commit is contained in:
zhongwuzw 2018-09-13 10:48:52 +08:00
parent 991fd89985
commit 504dc10491
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,8 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
#if SD_MAC
return image.size.height * image.size.width;
#elif SD_UIKIT || SD_WATCH
return image.size.height * image.size.width * image.scale * image.scale * CGImageGetBitsPerPixel(image.CGImage) / 8;
NSUInteger imageSize = image.size.height * image.size.width * image.scale * image.scale * CGImageGetBitsPerPixel(image.CGImage) / 8;
return image.images ? (imageSize * image.images.count) : imageSize;
#endif
}