GKImagePicker icon indicating copy to clipboard operation
GKImagePicker copied to clipboard

iOS8: Camera Freeze on Cancel

Open micnguyen opened this issue 11 years ago • 3 comments
trafficstars

Hi,

There is an issue on iOS8 that will stall the camera when the user cancels out of the crop-area.

Repro Steps:

  • Launch the GKImagePicker with a camera source and any crop size (resizable or not).
  • Take the photo.
  • Press 'Use Photo'.
  • In the crop image view, press 'Cancel'.
  • The crop image view should be dismissed, and goes back to the camera view.
  • On iOS8: The actual camera view is blurred out and doesn't reflect what the camera is seeing. You just see a static, blurred image. You can still however take an image, and the image is proper.
  • On iOS7: The actual camera view returns, enabling you to take another photo properly.

I suspect it may have to do with the way iOS8 handles action sheets (?), and the behaviour of dismissing the CropImageViewController. I'm currently investigating it.

Anyone bumped into this, or fixed it?

micnguyen avatar Oct 08 '14 01:10 micnguyen

It seems that we need to dismiss the image picker and present it again. Did you find a different solution?

hmyap avatar Nov 07 '14 08:11 hmyap

Yep - so I have fixed the issue. I'm not sure what's going on - but it seems like in IOS8 the UIImagePickerController isn't releasing the Camera resource fast enough. It displays as being available but when you do call it, it doesn't refresh the UIImagePickerController Camera view.

So the solution to this is to dismiss the image picker and then display it again. The trick however is to display it after a certain time period - if you display it immediately, it will still show as being blank. I have found 0.5seconds to be the optimal time for it to rejig itself.

micnguyen avatar Nov 07 '14 14:11 micnguyen

I think I am having the same issue ... when I press cancel it goes back to the camera view but is locked up. I saw from your comment that I need to dismiss and then display again but where do I do that ? I implemented the delegate method - (void)imagePickerDidCancel:(GKImagePicker *)imagePicker but it never is called. I have the delegate set correctly though because if I pick from my photo roll or not cancel from the camera - (void)imagePicker:(GKImagePicker *)imagePicker pickedImage:(UIImage *)image correctly. How can I determine if the user has canceled from the camera so I can then pause and re-launch ? or is there somewhere else I need to modify the code ? This is for IOS 8

ghost avatar Mar 19 '17 19:03 ghost