-
Notifications
You must be signed in to change notification settings - Fork 3
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
1507: Mobile scanner does not recognize barcodes #1524
1507: Mobile scanner does not recognize barcodes #1524
Conversation
d66b5c8
to
5bf5e8c
Compare
returnImage: false, | ||
); | ||
torchEnabled: false, detectionSpeed: DetectionSpeed.normal, formats: [BarcodeFormat.qrCode], returnImage: false); | ||
final MobileScannerController _controllerCameraResolution = MobileScannerController( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how i can avoid defining different controllers twice since cameraResolution
has no setter to change it
I hope i could extend it somehow just by cameraResolution
2bbb2ef
to
f98cd05
Compare
f98cd05
to
1641778
Compare
final MobileScannerController _controller = MobileScannerController( | ||
torchEnabled: false, | ||
detectionSpeed: DetectionSpeed.normal, | ||
formats: [BarcodeFormat.qrCode], | ||
returnImage: false, | ||
); | ||
torchEnabled: false, detectionSpeed: DetectionSpeed.normal, formats: [BarcodeFormat.qrCode], returnImage: false); | ||
final MobileScannerController _controllerPredefinedCameraResolution = MobileScannerController( | ||
torchEnabled: false, | ||
detectionSpeed: DetectionSpeed.normal, | ||
formats: [BarcodeFormat.qrCode], | ||
returnImage: false, | ||
cameraResolution: const Size(640, 480)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not entirely sure if it works, but you could make the _controller
non-final and simply overwrite if/once we detect it is a problematic device (instead of setting the _hasCameraIssues
flag).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good (enough) to me :D Let's see if this fixes it for the reports that we got.
If you have tested on a separate device and this should be mergable I think :D
Yes since i adjusted some minor things, i will test it today again with the real device |
@michael-markl i just tested it again and realized that this implementation needed a future builder to handle async functions in the |
Short description
Some android cameras don't recognize barcodes due to some upstream android camera issues.
This seem to be related to the defaultCamera resolution each device uses
juliansteenbakker/mobile_scanner#698
Its not that easy to detect which cameras may be issued to not apply this on all android devices.
Proposed changes
Side effects
Resolved issues
Related: #1507
Note
I'm not sure if we should set the cameraResolution to all android devices because it looks ugly. But its also difficult to maintain particular models, so let me know what you think. We could keep the issue open if new devices will be reported.
Testing (dev only)
This bugfix is only testable with the particular device, but you can just check if the controller applies, if you add your model to
devicesWithoutQRCodeDetection
list and check if the resolution of the camera changes