If pictures are loaded into an app from a album, how is it possible to get the filesize in MB and the date of that picture displayed on a app like on the screenshot below?
I know you can retrieve the filesize via a NSLog using the following code, but how can I get this into a string and also the date of that picture?
NSLog(@"size of image in KB: %i",[UIImagePNGRepresentation(UIImage) length]);
Use CoreGraphics
size_t imageSize = CGImageGetBytesPerRow(image.CGImage) * CGImageGetHeight(image.CGImage);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.