Decode QR codes and barcodes in text capture - #2096
Open
x1xhlol wants to merge 9 commits into
Open
Conversation
…notification setting, avoid revealing main window after OCR, restore macOS diagnostics bindings
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.
Summary
Extends the text-capture flow (Ctrl/Cmd+Shift+T) with QR code and barcode recognition: if the selected area contains a QR code or barcode, its decoded payload is copied to the clipboard instead of running OCR. No code found → falls back to OCR exactly as before.
barcodemodule usingrxing(Rust port of ZXing — free, on-device, supports QR plus the common 1D/2D barcode formats), decoding withTryHarderon the captured region's luma data.capture_ocr_texttries the barcode decode first (on a blocking task), and only falls back to OCR when nothing is found:Builds on #2095 (OCR text capture); the barcode change itself is the top commit.
Showcase
Select a QR code and its payload is on the clipboard, ready to paste:
Testing (Windows, end-to-end on a live dev build)
macOS compiles the same path (the decoder is pure Rust, platform-independent); runtime-tested on Windows only.
Greptile Summary
The PR adds barcode and QR decoding ahead of native OCR in the desktop text-capture flow.
rxingdecoder and copies decoded payloads directly to the clipboard.Confidence Score: 4/5
The PR appears safe to merge, with only a non-blocking redundant comment to remove.
The barcode-first capture path retains OCR fallback behavior, keeps persisted fields backward-compatible, and coordinates overlay cleanup across success and failure paths; the only accepted concern is comment-policy compliance.
Files Needing Attention: apps/desktop/src-tauri/src/barcode.rs
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "Decode QR codes and barcodes in text cap..." | Re-trigger Greptile
Context used (3)