Comments (3)
I have fixed it, putting this here for others who have the same issue or hoping contributors could possibly add this as a function of the app to chose which lens to use.
- I downloaded a local copy of the git
- In Xcode I removed the dependency on the package from git (Click on the main blue project icon, package dependencies, WeScan, and clicked - )
- Added the package dependancy based on the local copy (so I could alter the files of the package) - XCode, File, Add Package Depdancy, click Add Local button, browse for the local copy and add
- The following 4 files were where I found the code is selecting AVCaptureDevice (in Scan and Session folders): CameraScannerViewController, CaptureSessionManager, ScannerViewController, CaptureSession
- Search for AVCaptureDevice and replace this: guard let device = AVCaptureDevice.default(for: AVMediaType.video) with the following to CameraScannerViewController and ScannerViewController:
let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInTripleCamera, .builtInDualWideCamera, .builtInDualCamera, .builtInWideAngleCamera], mediaType: .video, position: .back)
let selectedDevice = discoverySession.devices.first guard let device = selectedDevice else { return }
-
Add this to CaptureSession:
let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInTripleCamera, .builtInDualWideCamera, .builtInDualCamera, .builtInWideAngleCamera], mediaType: .video, position: .back)
let selectedDevice = discoverySession.devices.first self.device = selectedDevice
-
And add this to CaptureSessionManager:
let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInTripleCamera, .builtInDualWideCamera, .builtInDualCamera, .builtInWideAngleCamera], mediaType: .video, position: .back)
let selectedDevice = discoverySession.devices.first guard let device = selectedDevice else { let error = ImageScannerControllerError.inputDevice delegate?.captureSessionManager(self, didFailWithError: error) return nil }
Some links I found helpful:
https://teng.pub/technical/2022/6/9/let-ios-decide-the-best-lens-to-use
https://developer.apple.com/documentation/avfoundation/capture_setup/choosing_a_capture_device
from wescan.
This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.
from wescan.
Is this fix going to be integrated to the codebase at some point? We are facing the same issue and would be nice to not have to fork the repo for this fix.
from wescan.
Related Issues (20)
- Should we fix swift lint errors? HOT 1
- Scan Color Change HOT 1
- Corner Detection Error HOT 2
- Change Background Color HOT 2
- From gallery : No such file or directory
- Carthage Dependency "WeScan" has no shared framework schemes HOT 3
- Error: Stored properties cannot be marked unavailable with '@available' HOT 1
- SwiftLint Configuration Error building example project HOT 1
- Lenses in corner selectors show wrong part of image HOT 4
- Compile error building package in Xcode 15.0 beta HOT 9
- iOS 17: Stored properties cannot be marked unavailable with '@available' HOT 1
- Xcode 14 Beta 4 build time error HOT 3
- pod trunk version seems stuck at 1.7 / updating WeScan in a Flutter dependency HOT 2
- Crash happende when we upload large size of image HOT 4
- [!] CocoaPods could not find compatible versions for pod "WeScan": In Podfile: WeScan (~> 3.0.0) HOT 1
- Crash on xcode 15.0 HOT 3
- Stored properties cannot be marked unavailable with '@available' HOT 1
- "Stored properties cannot be marked unavailable with '@available'" HOT 4
- Edges detection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wescan.