我有一个UIImagePicker选择,在选择图像时,它会返回一个包含以下条目的信息词典:
UIImagePickerControllerMediaType = "public.image"
UIImagePickerControllerOriginalImage = "<UIImage:0x3333333>"
UIImagePickerControllerReferenceURL = "assets-library://asset/asset.JPG?id=1000000001&ext=JPG"
如何访问所选图像文件的BLOB内容?
答案 0 :(得分:0)
你不能这样做吗?
NSData *data = [NSData dataWithContentsOfURL:[info objectForKey:UIImagePickerControllerReferenceURL]];
<强>替代地强>
UIImage *image = [info objectForKey: UIImagePickerControllerOriginalImage]; // or you can use UIImagePickerControllerEditedImage too
NSData *data = UIImageJPEGRepresentation(image, 1.0);
然后访问bytes
。