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

UI freezes after capturing photo on iOS #19

Open
rlunden opened this issue Sep 28, 2021 · 7 comments
Open

UI freezes after capturing photo on iOS #19

rlunden opened this issue Sep 28, 2021 · 7 comments

Comments

@rlunden
Copy link

rlunden commented Sep 28, 2021

The UI gets stuck after capturing a photo on iOS 14.7.1 (not sure about other versions) and no errors are reported, but if I launch the app again from Xcode when I already have it installed it starts working. However if I uninstall it then install it again the same issue occurs.

I paused the debugger while it was frozen and the debugger gave me the following location in the code. It seems to be related to the image context or the drawInRect function:

UIGraphicsBeginImageContext(CGSizeMake(enhancedImage.extent.size.height, enhancedImage.extent.size.width));
[[UIImage imageWithCIImage:enhancedImage scale:1.0 orientation:UIImageOrientationRight] drawInRect:CGRectMake(0,0, enhancedImage.extent.size.height, enhancedImage.extent.size.width)];

I'd be happy to help but I've never done any native iOS development so it'll take a while for me so i'd be very grateful if you could look into this.

@eliasteeny
Copy link
Owner

Hello, after iOS 14 release, I didn't have the chance to do any testing regarding this package because I don't have any access to a mac device although I'm sure there is couple of bugs that need fixing.
Did you handle camera permissions before building the scanner widget ? Because once the scanner widget gets rendered for the first time, if there isn't any camera permissions it doesn't work even after the user accepts the camera permission, it needs disposing then a new rebuild or in your case: launch the app again from Xcode.
So you should render a temporary widget until the user accepts or denies the permission.

@rlunden
Copy link
Author

rlunden commented Oct 16, 2021

I see. Yes, I made sure that I did handle them. This is a better rewrite of the original react native package: https://github.com/HarvestProfit/react-native-rectangle-scanner

The maintainer claims that the original package has old iOS code with lots of memory leaks.

I'll probably look into creating a Flutter wrapper for it when I have time.

@amirhasanovic
Copy link

Hello @eliasteeny is there any update regarding this topic?
My application is pretty dependant on this and am having trouble for the last month regarding my iOS app.

@eliasteeny
Copy link
Owner

Hello @amirhasanovic, unfortunately there isn’t any new update. I still don’t have any access to a macintosh machine to test and fix this bug.
Can you run your app through Xcode and provide the exception and stacktrace being thrown so I can try to provide a hotfix for the time being.

@amirhasanovic
Copy link

@eliasteeny thanks for your response. I have sent you an email via the address that I found on your website. Hope to hear more from you.

@hcaz
Copy link

hcaz commented Feb 2, 2022

Hi, Did you ever find a work around for this on iOS?

@johnwcchau
Copy link

I suspect this bug is related to CIContext, code will work fine if no work of CIImage/CIFilter is involved (i.e. not rendering the final output), I fixed this by moving the image rectifying code into dart using dart_image library, slow as hell but at least working.

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

5 participants