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

iPhone 14 Focus Distance #89

Closed
MikeMilzz opened this issue Oct 31, 2022 · 7 comments · Fixed by #102 or #127
Closed

iPhone 14 Focus Distance #89

MikeMilzz opened this issue Oct 31, 2022 · 7 comments · Fixed by #102 or #127
Labels
bug Something isn't working

Comments

@MikeMilzz
Copy link

With the change in minimal focal distance on the standard camera with iPhone 14, I've found it harder to scan smaller barcodes. I have read articles about trying to force the macro camera / mode. Have others noticed the same issue or found ways around it?

@ebi
Copy link

ebi commented Nov 29, 2022

This happens on iPhone 13 Pro aswell

@ariarora14
Copy link

I have also experienced this issue. There is usually an autofocus enabled property in AVFoundation but Im not sure how to access it and edit it and if that is even possible. @twostraws Any help with this one please?

@MikeMilzz
Copy link
Author

I'm testing another barcode scanner and here is what I did to resolve the issue. I had to limit it to iPhone because it was causing issues on iPad and macOS so be careful where you use .builtInUltraWideCamera but this will help with the focus distance.

let deviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInUltraWideCamera, .builtInWideAngleCamera], mediaType: AVMediaType.video, position: cameraPosition)

@nathanfallet nathanfallet added the bug Something isn't working label Feb 15, 2023
@nathanfallet
Copy link
Collaborator

Maybe conditionally select the camera when instantiating can solve the problem?
Feel free to try to make a PR if you find something

@ariarora14
Copy link

@MikeMilzz where did you add the discoverySession in the context of the current library?

@bennokress
Copy link
Contributor

I have opened a PR that uses the Ultra Wide Camera if available for the current device as a default parameter of the CodeScanner. It's a combination of what was proposed in previous comments here.

@IfThenDev
Copy link

I believe this issue was resolved with the patches above but in the meantime I've found more info that the following devices might be the more up-to-date solutions.

AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInTripleCamera, .builtInDualWideCamera, .builtInUltraWideCamera, .builtInWideAngleCamera, .builtInTrueDepthCamera], mediaType: AVMediaType.video, position: cameraPosition)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
6 participants