我从didFinishPickingMediaWithInfo获取图像.
UIImage *originalImage = (UIImage*)[info valueForKey:UIImagePickerControllerOriginalImage];
我想要获取Kb的图像的大小.
解决方法
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]); originalImage = nil;