I am getting Image from didFinishPickingMediaWithInfo
.
UIImage *originalImage = (UIImage*)[info valueForKey:UIImagePickerControllerOriginalImage];
<
I think the op's size (kb)
is the memory size of originalImage
, right?
Check out the usage about malloc_size
under the ARC refer to this.
#import <malloc/malloc.h>
NSLog(@"Size of %@: %zd", NSStringFromClass([originalImage class]), malloc_size((__bridge const void *)originalImage));
UIImage *originalImage = (UIImage*)[info valueForKey:UIImagePickerControllerOriginalImage];
NSData *imgData = UIImageJPEGRepresentation(originalImage, 1); //1 it represents the quality of the image.
NSLog(@"Size of Image(bytes):%d",[imgData length]);
imgData = nil;