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