I am having an issue with UIImagePickerController with allowsEditing = YES. I am unable to crop the image from the bottom but also I have an extra empty space on top when moving the crop rectangle.
Also in the method.
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
I log info and it gives me wrong CropRect (which is not square!)
UIImagePickerControllerCropRect = "NSRect: {{0, 357}, {666, 646}}";
UIImagePickerControllerEditedImage = "<UIImage: 0x7f9b8aa47b30> size {640, 618} orientation 0 scale 1.000000";
UIImagePickerControllerMediaType = "public.image";
UIImagePickerControllerOriginalImage = "<UIImage: 0x7f9b8868e5a0> size {1500, 1001} orientation 0 scale 1.000000";
Does anyone has this bug and how do you fix it?
See the picture below
I have no idea how, but i totally removed "View controller-based status bar appearance" key row (just fully delete this row) in .plist file and it fixed this bug
I couldn't set the "View controller-based status bar appearance" to YES, so I have tried to hide the status bar when I show the UIImagePickerController like so:
let imagePickerController = UIImagePickerController()
...
myViewController.present(imagePickerController, animated: true) {
UIView.animate(withDuration: 0.25, animations: {
UIApplication.shared.isStatusBarHidden = true
})
}
Then on the UIImagePickerControllerDelegate
didFinishPickingMediaWithInfo
I show the status bar, and it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With