Merge commit '7d9337406760603ddee47d5515e1e4835618b6b2' into cost_compute_fix

This commit is contained in:
Michael Gray 2014-10-31 14:32:51 -04:00
commit dfd2e2a2f1
1 changed files with 3 additions and 3 deletions

View File

@ -147,7 +147,7 @@ BOOL ImageDataHasPNGPreffix(NSData *data) {
return;
}
[self.memCache setObject:image forKey:key cost:image.size.height * image.size.width * image.scale];
[self.memCache setObject:image forKey:key cost:image.size.height * image.size.width * image.scale * image.scale];
if (toDisk) {
dispatch_async(self.ioQueue, ^{
@ -234,7 +234,7 @@ BOOL ImageDataHasPNGPreffix(NSData *data) {
// Second check the disk cache...
UIImage *diskImage = [self diskImageForKey:key];
if (diskImage) {
CGFloat cost = diskImage.size.height * diskImage.size.width * diskImage.scale;
CGFloat cost = diskImage.size.height * diskImage.size.width * diskImage.scale * diskImage.scale;
[self.memCache setObject:diskImage forKey:key cost:cost];
}
@ -302,7 +302,7 @@ BOOL ImageDataHasPNGPreffix(NSData *data) {
@autoreleasepool {
UIImage *diskImage = [self diskImageForKey:key];
if (diskImage) {
CGFloat cost = diskImage.size.height * diskImage.size.width * diskImage.scale;
CGFloat cost = diskImage.size.height * diskImage.size.width * diskImage.scale * diskImage.scale;
[self.memCache setObject:diskImage forKey:key cost:cost];
}