UIImagePickerControllerEditedImage edited image offset for iOS 11

I use UIImagePickerControllerwith allowsEditingfor sharing images in the application, but found that the cropped image is biased for devices with iOS 11.

My UIImagePickerControllerDelegateimplementation is pretty 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 the difference. iOS 10 on the right, iOS 11 on the left. You can see that the iOS 11 image is shifted down, although the crop rectangle was placed exactly in the same place.

iOS 10 vs iOS 11 edited image

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

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

, UIImagePickerController, , .

Apple: http://www.openradar.me/36292067

+4

Source: https://habr.com/ru/post/1691606/


All Articles