Skip to content

Commit

Permalink
Fixed image memory calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
周明宇 committed Feb 17, 2016
1 parent 32547b0 commit fac9d87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions UIKit+AFNetworking/AFAutoPurgingImageCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ -(instancetype)initWithImage:(UIImage *)image identifier:(NSString *)identifier

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;
Expand Down

0 comments on commit fac9d87

Please sign in to comment.