Issue with ImagePickerController cropping

本小妞迷上赌 提交于 2020-01-06 05:41:21

问题


I'd like user to be able to crop images they've selected from photo library via ImagePickerController.

Ive allowed editing.

self.imgPicker.allowsEditing = true

And retrieve edited version of image.

let img = info[UIImagePickerControllerEditedImage] as? UIImage

The top of the image is not fully cropped. This is Apples code. Do I need to implement something custom?

Crop (should only show image, all white is cropped out):

Result:


回答1:


It's a default behavior when you click picture from the camera this issue won't arise but when you pick a picture from the photo gallery it will be there.

You can always use the alternative in your case I would suggest YPImagePicker

OR you can crop the image manually refer this LINK

I hope it helps.



来源:https://stackoverflow.com/questions/49810844/issue-with-imagepickercontroller-cropping

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