我想从UIImagepicker选取一张图片,相机胶卷中有PNG和JPG格式。
我需要将其转换为NSData。但是,我需要知道这张图片是使用UIImageJPEGRepresentation
还是UIImagePNGRepresentation
,以便我能够进行转换。
UIImage *orginalImage = [info objectForKey:UIImagePickerControllerOriginalImage];
[picker dismissViewControllerAnimated:YES completion:nil];
NSData *orgData = UIImagePNGRepresentation(orginalImage);