Fix memory cache image cost miscalculation for 4.x

This commit is contained in:
zhongwuzw 2018-09-12 23:04:45 +08:00
parent 88d3e281ca
commit 991fd89985
1 changed files with 1 additions and 1 deletions

View File

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