ZBar
$ zbarimg Community Low RiskZBar's zbarimg decodes QR codes, EAN-13, UPC, Code 128, and other barcodes from PNG, JPEG, or TIFF images without touching disk. It offers --raw for bare decoded values, --xml for structured symbol metadata, and -q quiet suppression.
brew install zbar Decoding barcodes and QR payloads from local images via zbarimg --raw -q is fast and self-contained.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --raw clean values, --xml structured output, -q quiet mode, and deterministic exit codes (0 found, 4 none found), though lacks --json.
- Supports
--raw,--xml, and-q - Uses exit code
4when no barcode is detected
zbarimg is strictly read-only and never writes or modifies files on disk.
- Zero filesystem write capability in
zbarimg
Available via brew install zbar and Linux zbar-tools; Windows installation requires older binaries or WSL.
- Available on macOS Homebrew and major Linux distros
Reliable multi-symbology decoder supporting QR, EAN/UPC, Code 128, Code 39, and multi-page TIFFs.
- Decodes both QR and 1D retail/logistics barcodes
Community-maintained fork (mchehab/zbar) keeping the classic ZBar suite alive on modern toolchains.
- Maintained at
mchehab/zbaron GitHub
Concise --help and man page covering exit codes (0, 1, 2, 4) and -S symbology config switches.
- Man page and
zbarimg --helpdocumentation
Security, Auth & Guardrails
None required; strictly reads local image files.
Free LGPL-2.1-or-later open-source C binary.
# ZBar (zbarimg) Agent Rules - Expect exit code `4` when an image contains zero valid barcodes—handle exit code `4` gracefully rather than treating it as a crash. - Pass `-q` and `--raw` (or `--xml`) for clean machine-readable output.
Agent-Ready Command Recipes
Safe Read-Only Queries
zbarimg --raw -q qr.png
Prints only the decoded string(s) without symbology prefixes or scan summary lines.
zbarimg --xml -q scan.png
Outputs symbology type, decoded data, quality, and polygon coordinates as XML.
Strengths for Agents
- + Strictly read-only with
--raw -qand--xmlstructured output. - + Decodes both 2D QR codes and 1D barcodes from multi-barcode images in one pass.
Caveats & Pitfalls
- ! Returns exit code
4when no barcode is detected in an image, which breaks naiveset -epipelines. - ! Outputs
--xmlrather than--json, and does not support Data Matrix or Aztec codes reliably.