Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS8: Camera Freeze on Cancel #47

Open
micnguyen opened this issue Oct 8, 2014 · 3 comments
Open

iOS8: Camera Freeze on Cancel #47

micnguyen opened this issue Oct 8, 2014 · 3 comments

Comments

@micnguyen
Copy link

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?

@hmyap
Copy link

hmyap commented Nov 7, 2014

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

@micnguyen
Copy link
Author

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.

@ghost
Copy link

ghost commented Mar 19, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants