Browse Source

Fixed image memory calculation

周明宇 9 năm trước cách đây
mục cha
commit
fac9d87340
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      UIKit+AFNetworking/AFAutoPurgingImageCache.m

+ 2 - 2
UIKit+AFNetworking/AFAutoPurgingImageCache.m

@@ -44,8 +44,8 @@
 
         CGSize imageSize = CGSizeMake(image.size.width * image.scale, image.size.height * image.scale);
         CGFloat bytesPerPixel = 4.0;
-        CGFloat bytesPerRow = imageSize.width * bytesPerPixel;
-        self.totalBytes = (UInt64)bytesPerPixel * (UInt64)bytesPerRow;
+        CGFloat bytesPerSize = imageSize.width * imageSize.height;
+        self.totalBytes = (UInt64)bytesPerPixel * (UInt64)bytesPerSize;
         self.lastAccessDate = [NSDate date];
     }
     return self;