Skip to content

feat: Java-free decode via zxingcpp fallback#11

Merged
greyllmmoder merged 3 commits intomainfrom
feat/zxingcpp-decode
Apr 9, 2026
Merged

feat: Java-free decode via zxingcpp fallback#11
greyllmmoder merged 3 commits intomainfrom
feat/zxingcpp-decode

Conversation

@greyllmmoder
Copy link
Copy Markdown
Owner

Summary

  • decode() now tries zxingcpp first (pure C++, no JVM) and falls back to python-zxing
  • Adds decode-fast optional extra: pip install "aztec-py[decode-fast]"
  • Normalises zxingcpp's <GS> token to raw \x1d for correct GS1 group separator roundtrip
  • Helpful RuntimeError message lists both install options when neither backend is present

Testing

  • Existing 3 tests updated (new error match string)
  • 3 new tests: fast path, empty result, and fallback to zxing
  • All compat matrix and conformance tests continue to pass
  • Full suite passes, coverage ≥90%

Notes / Risks

  • Backwards compatible — behaviour identical when only python-zxing is installed
  • GS normalisation fixes a latent decode mismatch in the compat matrix for GS1 variable payloads

@greyllmmoder greyllmmoder force-pushed the feat/zxingcpp-decode branch from 81708f4 to b4caceb Compare April 9, 2026 07:55
Add zxingcpp as the preferred decode backend (no JVM required), falling back
to python-zxing for legacy environments. Normalises zxingcpp's <GS> token to
raw \x1d so GS1 group separator payloads round-trip correctly.

- decode() tries zxingcpp first (pip install 'aztec-py[decode-fast]')
- Falls back to python-zxing if zxingcpp absent
- Raises RuntimeError with install instructions if neither is present
- New decode-fast extra in pyproject.toml: zxingcpp>=2.2 + pillow
- 3 new tests covering fast path, empty result, and fallback behaviour
- All 97 tests pass, coverage 91%
@greyllmmoder greyllmmoder force-pushed the feat/zxingcpp-decode branch from b4caceb to 3bdf4ad Compare April 9, 2026 07:58
@greyllmmoder greyllmmoder merged commit a2119a0 into main Apr 9, 2026
16 checks passed
@greyllmmoder greyllmmoder deleted the feat/zxingcpp-decode branch April 9, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant