Repository navigation
Conversation
sneurlax
force-pushed
the
fix/qr-camera-frame-scaling
branch
from
November 2, 2026 21:01
ca5e085 to
e902a58
Compare
Camera frames are now scaled to fit 1280 px before scanning, which keeps decoding fast when a camera hands back a large frame. Before the Windows scanner read frames from the preview, a USB webcam there returned 3264x2448 photos even at the medium preset, which took 2-3 s per frame to decode and scan on an older laptop. Windows preview captures now use the same 1280 px cap. Files from Select file are still scanned at full size.
julian-CStack
force-pushed
the
fix/qr-camera-frame-scaling
branch
from
November 2, 2026 21:13
e902a58 to
1ae0ee7
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix/linux-qr-camera-timeout #1489 +/- ##
============================================================
Coverage 11.64% 11.64%
============================================================
Files 1136 1136
Lines 114351 114356 +5
============================================================
+ Hits 13319 13322 +3
- Misses 101032 101034 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base:
fix/linux-qr-camera-timeout. Last of three stacked PRs on top of the Windows QR camera fix.Large camera frames make live QR scanning on desktop slow, and a QR code held up to a webcam doesn't need that resolution.
Cause
Decoding and binarizing a full-size camera frame is expensive. Before #1485 moved the Windows scanner to in-memory preview captures,
camera_windows'takePicture()returned the camera's largest still mode regardless of preset: a Depstech USB webcam gave 3264x2448 photos at the medium preset, and each one took 2 to 3 seconds to decode on an older laptop. Windows no longer captures at that size, but nothing in the decode path limits frame size for other cameras or platforms.Change
decodeQrFromImagetakes an optionalmaxDimension. Images with a longer side above it are scaled down (area-averaging) before decoding, and smaller images are left alone.The scaling applies on every desktop platform, to any camera frame larger than 1280 px.