我已使用以下代码打开图库
UIImagePickerController *pickerView = [[UIImagePickerController alloc] init];
pickerView.delegate = self;
pickerView.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
pickerView.allowsEditing=true;
[self presentViewController:pickerView animated:TRUE completion:nil];
我还在UIViewController中设置了委托。
但我获得了 UIImagePickerControllerEditedImage 的零值
在- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info;
我还打印了信息的值并得到了以下结果。
打印信息说明:
{
UIImagePickerControllerCropRect = "NSRect: {{0, 0}, {2999.999927356841, 2006.2499514198873}}";
UIImagePickerControllerImageURL = "file:///Users/admin/Library/Developer/CoreSimulator/Devices/..../A33241F6-6CAB-4B0E-8B21-3D81797A4079.jpeg";
UIImagePickerControllerMediaType = "public.image";
UIImagePickerControllerOriginalImage = "<UIImage: 0x6040002bb2a0> size {3000, 2002} orientation 0 scale 1.000000";
UIImagePickerControllerReferenceURL = "assets-library://asset/asset.JPG?id=ED7AC36B-A150-4C38-BB8C-B6D696F4F2ED&ext=JPG";
}
在这里你可以看到iOS没有给出UIImagePickerControllerEditedImage值。
这是iOS 11 Bug还是如何获取已编辑的图像对象?