Symbologies
What the grader does for each symbology, and how much of it is tested.
Every "yes" below is asserted in test/coverage.test.ts: a symbol is drawn with bwip-js (or a corpus file is used), graded through gradeFile, and the report is checked. Every gap that test file used to mark as an expected failure is now closed. Run it with npx tsc -p . && npx vitest run test/coverage.test.ts.
Corpus counts are files in bench/corpus/manifest.json (387 files), counted by script from each item's format, gs1 flag, data and description. "Read" is the number of those files whose code was found and decoded in bench/runs/latest/rows.json (381 of 387).
GS1 symbologies
| Symbology | Found and decoded | Check digit, data syntax | Size against GS1 | Bar height | Quiet zones | Colour | Predicted grade | Digits under the code | Corpus files (read) |
|---|---|---|---|---|---|---|---|---|---|
| EAN-13 | yes | GTIN check digit; prefix meaning | yes: 0.264–0.660 mm (80–200%) | yes: 22.85 mm at 0.330 mm | yes: 11X / 7X | yes | yes, against 1.5/06/660 | compared with PDF text; missing digits detected | 160 (159) |
| UPC-A | yes | GTIN check digit; prefix meaning | yes: 80–200% | yes: 22.85 mm at 0.330 mm | yes: 9X / 9X | yes | yes, against 1.5/06/660 | as EAN-13 | 96 (94) |
| EAN-8 | yes | GTIN check digit; prefix meaning | yes: 80–200% | yes: 18.23 mm at 0.330 mm | yes: 7X / 7X | yes | yes, against 1.5/06/660 | as EAN-13 | 15 (15) |
| UPC-E | yes | GTIN check digit; number system 0 only (fail); zero suppression | yes: 80–200% | yes: 22.85 mm at 0.330 mm | yes: 9X / 7X | yes | yes, against 1.5/06/660 | as EAN-13 | 13 (13) |
| Add-ons (EAN-2, EAN-5) | yes, when ZXing reads them: up to about 10X from the main symbol (GS1 allows 7X to 12X, so one at 12X is missed). The digits are in addOn and the summary | not checked | no | no | no | no | no | no | 0: untested in the public corpus |
| ITF-14 | yes (format ITF, name "ITF-14") | GTIN check digit; 14 digits; wide-to-narrow ratio 2.25–3.0 (fail); bearer bars | yes: 0.495–1.016 mm | yes: 31.75 mm | yes: 10X / 10X | yes | yes, against 1.5/10/660, or 0.5/20/660 from X 0.635 mm | compared with PDF text | 26 (25) |
| GS1-128 | yes | every AI in GS1's table, with its format and content; check digits; pairs and partners; 165.10 mm; 48 characters counting separators | yes: 0.495–1.016 mm | yes: 31.75 mm | yes: 10X / 10X | yes | yes, against 1.5/10/660 | bracketed text in a PDF compared | 27 (27) |
| GS1 DataBar Omnidirectional | yes | GTIN check digit | yes: 0.264–0.660 mm | yes: 46X (Table 5-44 note ****) | 1X guard space | yes | yes, against 1.5/06/660 | same code path as GS1-128; not tested on its own | 2 (2) |
| GS1 DataBar Stacked Omnidirectional | yes | GTIN check digit | yes | no: measured on one row, total height not judged | 1X | yes | yes, row by row | as above | 1 (1) |
| GS1 DataBar Truncated | yes | GTIN check digit | yes | reported as a short DataBar (check) | 1X | yes | yes | as above | 1 (1) |
| GS1 DataBar Stacked | yes | GTIN check digit | yes | reported as a short DataBar (check) | 1X | yes | yes, row by row | as above | 1 (1) |
| GS1 DataBar Limited | yes | GTIN check digit; always a check "not for tills" | no | yes: 10X | 1X | yes | yes, against 1.5/06/660 | as above | 1 (1) |
| GS1 DataBar Expanded | yes | as GS1-128; 74 digits / 41 characters | yes: 0.264–0.660 mm | yes: 34X | 1X | yes | yes, against 1.5/06/660 | as above | 2 (2) |
| GS1 DataBar Expanded Stacked | yes | as Expanded | yes | no: measured on one row | 1X | yes | yes, row by row | as above | 1 (1) |
| GS1 DataMatrix | yes, square and the six rectangular sizes; a DMRE size is a check | as GS1-128; FNC1 | yes: 0.396–0.990 mm (0.743 mm with AI 8200) | n/a | yes: 1X, four sides | yes | yes, against 1.5/12/660 | same code path as GS1-128; not tested on its own | 11 (10) |
| Data Matrix with a GS1 Digital Link | yes | as QR Code with a GS1 Digital Link | yes: 0.396–0.990 mm | n/a | yes: 1X | yes | yes, against 1.5/12/660 | no | 0: untested in the public corpus |
| GS1 QR Code | yes | as GS1-128 | yes: 0.396–0.743 mm (Table 5-45) | n/a | yes: 4X, four sides | yes | yes, against 1.5/12/660 | same code path as GS1-128; not tested on its own | 2 (2) |
| QR Code with a GS1 Digital Link | yes | GTIN check digit; 14-digit GTIN and no convenience alphas (fail); path keys and order per Digital Link 1.7.0; scheme; every value in path and query | yes: 0.396–0.990 mm | n/a | yes: 4X | yes | yes, against 1.5/12/660 | no | 11 (11) |
"Colour" means the red-light checks in colour, from the colours the file is drawn in. "Yes, against" means the ISO/IEC 15416 or 15415 parameters are computed from the artwork and held to the minimum GS1 sets; grade says what that is worth. A size in "%" is an EAN/UPC magnification; every other symbology's size is reported and judged in millimetres.
Other symbologies the decoder reads
GS1 sets no size for these, so size is reported and never judged.
| Symbology | Found and decoded | Data checks | X-dimension reported | Quiet zones | Colour | Predicted grade | Corpus files (read) |
|---|---|---|---|---|---|---|---|
| Code 128 | yes | flags GS1 data or a bare GTIN encoded without FNC1 | yes | yes: 10X | yes | yes; flagged under 1.5 | 3 (3) |
| ITF, not 14 digits | yes | check: GS1 uses ITF only as ITF-14 | yes | yes: 10X | yes | yes | 0: untested in the public corpus |
| QR Code | yes | a link is shown; on a page with a retail barcode a plain link gets a check | yes | yes: 4X | yes | yes; flagged under 1.5 | 13 (12) |
| Data Matrix | yes | flags GS1 data without FNC1 | yes | yes: 1X | yes | yes; flagged under 1.5 | 1 (1) |
| Code 39 | yes | none | yes | yes: 10X | yes | yes; flagged under 1.5 | 0: untested in the public corpus |
| Code 93 | yes | none | yes, from its 9-module characters | no | yes | no | 0: untested in the public corpus |
| Codabar | yes | none | yes | no | yes | no | 0: untested in the public corpus |
| PDF417 | yes | none | yes, from the start pattern each row begins with | yes: 2X | yes | not predicted | 0: untested in the public corpus |
| MicroPDF417 | yes | none | yes, from the row address patterns | no | yes | not predicted | 0: untested in the public corpus |
| Aztec | yes | none | yes, from its layers and its bullseye (compact or full) | no | yes | not predicted | 0: untested in the public corpus |
| MaxiCode | yes | none | no | no | yes | not predicted | 0: untested in the public corpus |
| Micro QR | yes | none | yes, from its version | no | yes | not predicted | 0: untested in the public corpus |
| rMQR | yes | none | yes, from the size ZXing states | no | yes | not predicted | 0: untested in the public corpus |
| GS1 DotCode, Composite components | no | 0: untested in the public corpus |
"Not predicted": the summary says "A print-quality grade isn't predicted for this symbology." The 2D grade is modelled on the finder patterns and error correction of QR Code and Data Matrix only; a grade worked out on another symbology's structure would be a false verdict.
Known limits
| Symbol | What happens |
|---|---|
| EAN/UPC add-on 11X or 12X from the main symbol | not read by ZXing; the main symbol is graded alone |
| Stacked GS1 DataBar | total height not judged; grade is the mean of scans over its rows, a combination ISO/IEC 24724 may define differently (not verified) |
| GS1 Digital Link, compressed | not recognised as a Digital Link |
What the corpus doesn't hold
- No add-on, Code 39, Code 93, Codabar, PDF417, Aztec, MaxiCode, Micro QR or rMQR file, and no Data Matrix carrying a Digital Link. For those, the only evidence is one drawn symbol each in
test/coverage.test.ts. - One file each for five of the seven GS1 DataBar forms, and two for Omnidirectional and Expanded.
- Every corpus file is synthetic. The numbers for real artwork are in the README and are not reproducible from this repository.