如何获得UIImage的大小(KB)
我从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]); imgData = nil;