apphud
apphud

Reputation: 633

iOS 8 Bug with UIImagePickerController Image Crop

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 Unable to select the bottom part of image

Upvotes: 11

Views: 2348

Answers (2)

mt81
mt81

Reputation: 3318

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.

Upvotes: 1

nadirov
nadirov

Reputation: 62

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

Upvotes: 4

Related Questions