-
Notifications
You must be signed in to change notification settings - Fork 739
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
Iphone 4 focus problem #103
Comments
I am also dealing with this issue except my app doesn't do an initial focus. It's just blurry resolution regardless of camera/barcode distance and position. iPhone 4s, fully updated iOS, phonegap app built using Adobe's build.phonegap.com |
+1 to this. iPhone 4 running iOS 7.1 and the barcode scanner won't refocus. If you launch the barcode scanner with the phone at the right distance from the barcode then it focuses and scans. However if the barcode is not in focus when the scanner is launched the camera will never focus on it. |
I'm facing this issue too. Have you found a workaround or quick fix? |
I was able to state that the problem only appears on iPhones 4 and 7.0+ iOS. Are we all affected by this issue? If someone came up with a fix, even native, please share your solutions. |
I have tested this plugin on a few iOS devices running iOS 7+ and the problem lies on all of them but the problem is not limited to this plugin. I have also tried several apps and other plugins that use the zxing barcode scanner "framework" and none of them allowed the camera to refocus. I'm not an expert on this stuff so I hope this comment makes sense. If it does make sense, I have no idea what the solution would be. Right now, my solution is to release my app for Android only but I really need something working on iOS. |
Hmm, I have tested iPhones 4s 5 and 5c all running ios 7.1.x and they don't show any focus problem. You said that the problem is not limited to this plugin, did you repreduce it with an app that doesn't use zxing library? I'm afraid that this repo is currently being abandoned... |
I could not reproduce the focus bug using other libraries, I tried 3 apps that used the zxing library and 3 that didn't. Only the zxing libraries had the focus problem. Scanndit was the only other phonegap plugin I could find but being limited to the amount of scans you can use a month is a huge negative, plus it was much slower than this plugin. |
I've noticed the same problem -- on iPhone 4, the camera doesn't ever adjust the autofocus once the camera is capturing. Seems to work just fine on later models, though. I found PR #129 with a fix for this issue, and after doing some further investigation myself, I found that all I really needed to do was to add the following line to the
This just blocks the thread for 1ms, and presumably yields enough time for the camera auto-focus code to kick in. Since I already set the camera to continuous auto focus mode and set a focal point in the capture session initialization, I found it wasn't necessary to reset these values in each run of the callback. In general I'm not a fan of blocking like this, but it doesn't appear to impact the responsiveness of the app or the barcode recognition, plus it also lowers overall app CPU usage while the scanner is active (since it's not shoving as many frames through the processor). Hopefully this helps you out! |
@dpolivy Thank you for your solution, it works perfectly! |
For a user not understanding object C. Can you explain exactly where I put that "[NSThread sleepForTimeInterval:0.001f];" @dpolivy @michalzyka. Thx |
@crissi I think you can just put it at the end of the |
Thx man. Will take a look at your fork Christian
|
I seem to have a problem with the barcode scanner plugin. It seems that when starting a scan it takes the initial focus from the camera, but when you change position the camera doesnt refocus not even if I tap on the screen. What can I do.
The text was updated successfully, but these errors were encountered: