I want to get UIImage Object real memory size. There are 3 methods
NSUInteger s1 = UIImagePNGRepresentation(thumbImage).length;
NSUInteger s2 = UIImageJPEGRepresentation(thumbImage, 1).length;
NSUInteger s3 = CGImageGetHeight(thumbImage.CGImage) * CGImageGetBytesPerRow(thumbImage.CGImage);
NSLog(@"s1:%u",s1);
NSLog(@"s2:%u",s2);
NSLog(@"s3:%u",s3);
and result
s1:62734
s2:175939
s3:578816
which one is right?
The last one (s3) is correct:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With