UIImagePickerControllerEditedImage edited image offset for iOS 11

家住魔仙堡 提交于 2019-12-23 07:26:56

问题


I'm using a UIImagePickerController with allowsEditing enabled to share images in an App, but found that cropped image is offset for devices running iOS 11 only.

My UIImagePickerControllerDelegate implementation is quite simple, just standard actions:

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
    let image = info[UIImagePickerControllerEditedImage] as! UIImage

    imageView.image = image
    picker.dismiss(animated: true, completion: nil)
}

Below you can see difference. iOS 10 on the right, iOS 11 on the left. You can see the iOS 11 image is offset down, even though the cropping rectangle was put in exactly the same place.

Here is a video demonstrating the issue: https://www.dropbox.com/s/4csofidjcrc9ah6/UIImagePickerControllerEditedImageOffset.mp4?dl=0

I also created a demo project on GitHub to demonstrate the issue: https://github.com/aivars/photo-Picker-Tests

I would guess that it is UIImagePickerController bug, but wonder why do not find any other error reports online.

I also filed a bug report with Apple: http://www.openradar.me/36292067

来源:https://stackoverflow.com/questions/48056398/uiimagepickercontrollereditedimage-edited-image-offset-for-ios-11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!