Spec map
Every check the grader performs, the threshold in the code, and the clause it comes from.
- GS1 General Specifications: Release 26.0, ratified January 2026, read from the public PDF at
https://ref.gs1.org/standards/genspecs/. Section, table and figure numbers below, and in the source comments, are Release 26.0 numbers. - GS1 Digital Link Standard: URI Syntax: Release 1.7.0, ratified August 2026, read from
https://ref.gs1.org/standards/digital-link/uri-syntax/. - GS1 Barcode Syntax Dictionary: release 2026-01-27,
https://github.com/gs1/gs1-syntax-dictionary(Apache-2.0; licence inthird-party/gs1-syntax-dictionary/). Every Application Identifier, its format and its relationships are generated from it intosrc/rules/ai-table.tsbynpm run gen:ai(scripts/gen-ai-table.mjs;--checktells whether the committed table matches). - GS1 prefix list:
https://www.gs1.org/standards/id-keys/company-prefix, read 2026-11-27. - ISO/IEC standards are paywalled. A clause number is given only where the GS1 General Specifications restate it. Everywhere else the row names the standard and the parameter and says clause not verified.
Status means: implemented (the code does what the clause says), partial (what is missing is stated), differs (the code and the clause disagree; see Where the code differs from the spec). Source references name the file and the function or constant; line numbers aren't given, as they move.
Rule ids are the values of issues[].rule in the report: checkDigit, size, barHeight, quiet, colour, symbology, content, grade. Two more, read and print, are declared and never emitted (read, print).
checkDigit
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| GS1 modulo-10 check digit of the GTIN in EAN-13, UPC-A, EAN-8, UPC-E (expanded to GTIN-12), ITF-14 | last digit must equal the calculated one: src/rules/symbols.ts, src/rules/check.ts | GenSpecs §7.9.1; §5.2.2.1–5.2.2.4 and §5.3.2.1.3 require it in each symbol | implemented |
| The same when ZXing rejects the symbol with a checksum error: the bars decoded and only the check digit is wrong | recomputed, not taken from the error text: src/rules/evidence.ts, src/rules/check.ts | GenSpecs §7.9.1 | implemented for EAN/UPC and ITF-14 only |
| Check digit of AI (01) and of AI (00) in GS1-128, GS1 DataBar, GS1 DataMatrix, GS1 QR Code | src/rules/symbols.ts | GenSpecs §7.9.1, §3.3.1, §3.3.2 | implemented |
| Check digit of the GTIN in a GS1 Digital Link URI | src/rules/symbols.ts | GenSpecs §7.9.1; Digital Link §4.5 defers to the General Specifications | implemented |
Check digit of other keys inside element strings: every AI whose dictionary entry has the csum linter ((02), (253), (402), (410)–(417), (8017), (8018)…) | checkAiValue in src/rules/ai.ts; reported under symbology, not checkDigit | GenSpecs §7.9.1 | implemented, under another rule id |
| Check character pair of alphanumeric keys (GMN, AI 8013) | gs1CheckPair in src/rules/ai.ts, under symbology | GenSpecs §7.9.5 | implemented |
size
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| X-dimension of EAN-13, EAN-8, UPC-A, UPC-E | 0.264–0.660 mm, 0.330 mm = 100%; fail outside by more than 0.005 mm: src/rules/symbols.ts, src/rules/check.ts | GenSpecs §5.12.3.1, Table 5-44 (symbol specification table 1); §5.2.3.1 for the nominal 0.330 mm | partial: table 1 only. Tables 2 and 3 (0.495–0.660 mm for general distribution) and the 0.249 mm allowance for on-demand printing (Table 5-44 note *) can't be selected |
| EAN/UPC inside the range but under 90% (X under 0.297 mm) | advice in the summary, no issue: NEAR_MIN in src/rules/check.ts | GenSpecs §5.12.2.4 (consult the printer on the minimum size). The 90% line is this package's own | advice only |
| X-dimension of ITF-14 and GS1-128 | 0.495–1.016 mm: src/rules/symbols.ts | GenSpecs §5.12.3.2, Table 5-47 (table 2) | partial: table 2 only. Table 4 (0.250–0.495 mm), table 5 for SSCC labels (maximum 0.940 mm) and the 0.250 mm allowance for small items can't be selected |
| X-dimension of GS1 DataBar Omnidirectional, Stacked Omnidirectional, Expanded, Expanded Stacked | 0.264–0.660 mm: src/rules/symbols.ts | GenSpecs §5.12.3.1, Table 5-44 | partial: table 1 only; the 0.203 mm allowances in notes *** and ***** are not applied |
| X-dimension of GS1 DataBar Limited | not judged: SPECS.databar_limited | GenSpecs §5.5.2.2: not for retail POS, absent from Table 5-44; Tables 5-47 and 5-50 give ranges for other applications | not implemented |
| X-dimension of GS1 DataMatrix, Data Matrix with a Digital Link, QR Code with a Digital Link | 0.396–0.990 mm: POS_2D_X | GenSpecs §5.12.3.1, Table 5-46 (table 1 addendum 2) | implemented for table 1; tables 2–5 not selectable |
X-dimension of GS1 QR Code (FNC1, ]Q3), and GS1 DataMatrix carrying AI (8200) | 0.396–0.743 mm: POS_2D_8200_X | GenSpecs Table 5-45 (table 1 addendum 1); GS1 QR Code is in Table 5-45 only | implemented |
| How the size is worded | percent of 0.330 mm for EAN/UPC only (MAGNIFIED in src/rules/check.ts); mm for everything else, size.magnification null | GenSpecs §5.12.2.2: magnification is an EAN/UPC term; the tables give mm | implemented |
| X-dimension of plain QR, Data Matrix, Code 128, Code 39, ITF, PDF417 and the rest | reported, not judged | no GS1 requirement | by design |
| Tolerance on the X limits | 0.005 mm: src/rules/check.ts | GenSpecs §5.12.5.10.2 allows 2% for verifier variation (0.0053 mm at 0.264 mm) | implemented, slightly stricter at the upper limit |
barHeight
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| Bar height of EAN-13, UPC-A, UPC-E (data bars; the longer guard bars are left out) | 22.85 mm at 0.330 mm, scaled with X; fail under 95% of that: src/rules/symbols.ts, src/rules/check.ts | GenSpecs §5.2.3.2; Table 5-44 (18.28 / 22.85 / 45.70 mm). The 5% is the acceptance criterion of §5.12.5.10.2 | implemented |
| Bar height of EAN-8 | 18.23 mm at 0.330 mm, scaled: src/rules/symbols.ts | GenSpecs §5.2.3.2; Table 5-44 | implemented |
| Bar height of ITF-14 and GS1-128 | 31.75 mm at any X: src/rules/symbols.ts | GenSpecs Table 5-47 and its note ** | partial: the reductions to 12.70 mm and 5.08 mm for small items (note **), and table 4's 12.70 mm, can't be selected |
| Bar height of GS1 DataBar Omnidirectional | 46X (15.19 mm at 0.330 mm): SPECS.databar; fail from 33X to 46X with the 46X figure | GenSpecs §5.5.2.1.1 gives 33X as the symbology minimum; Table 5-44 and its note **** require 46X at retail POS (12.14 / 15.19 / 30.36 mm) | implemented |
| GS1 DataBar under 33X: Truncated and Stacked | check ("tills don't read those") unless a single-row symbol is between 7X and 13X, then fail | GenSpecs §5.5.2.1.2, §5.5.2.1.3 (both 13X high), §5.5.8 | implemented; stacked symbols are told apart by the finder's report |
| Bar height of GS1 DataBar Expanded | 11.23 mm at 0.330 mm (34X): SPECS.databar_expanded | GenSpecs §5.5.2.3.1; Table 5-44 (8.99 / 11.23 / 22.44 mm) | implemented |
| Total height of stacked DataBar symbols | not judged: measured on one row (rowOnly in src/rules/check.ts) | GenSpecs §5.5.2.1.4 (69X), Table 5-44 (95X for Stacked Omnidirectional at POS), §5.5.2.3.2 | not implemented |
| Minimum height of GS1 DataBar Limited | 10X: SPECS.databar_limited | GenSpecs §5.5.2.2: "10X high" | implemented |
quiet
Clear space is measured from the first and last bar (linear) or from each edge (2D), in modules, across the middle 70% of the bar height. A side is short when it measures less than the requirement minus 0.5X (src/rules/check.ts).
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| EAN-13 left / right | 11X / 7X: src/rules/symbols.ts | GenSpecs §5.2.3.4, Table 5-11 | implemented |
| EAN-8 | 7X / 7X: | Table 5-11 | implemented |
| UPC-A | 9X / 9X: | Table 5-11 | implemented |
| UPC-E | 9X / 7X: | Table 5-11 | implemented |
| ITF-14 | 10X / 10X: | GenSpecs §5.3.2.2 | implemented |
| GS1-128 | 10X / 10X: | GenSpecs §5.4.4.2 | implemented |
| GS1 DataBar | 1X each side (the guard pattern's own space): | GenSpecs §5.5.1.1 "Quiet Zones: None required" | implemented |
| QR Code, GS1 QR Code | 4X on four sides: | GenSpecs Tables 5-45 and 5-46; §5.12.5.1.2 note | implemented |
| Data Matrix, GS1 DataMatrix | 1X on four sides: | GenSpecs §5.6.2; Tables 5-45 and 5-46 | implemented |
| Code 128, Code 39, ITF (not GS1) | 10X: – | ISO/IEC 15417, ISO/IEC 16388, ISO/IEC 16390: quiet zone; clause not verified | implemented |
| PDF417 | 2X on four sides: | ISO/IEC 15438: quiet zone; clause not verified | implemented |
| Tolerance | requirement minus 0.5X | GenSpecs Table 5-63 gives the minimum a verifier accepts for EAN/UPC: EAN-13 10X / 6.2X, EAN-8 6.2X / 6.2X, UPC-A 8X / 8X, UPC-E 8X / 6.2X | partial: the code is stricter than Table 5-63 (UPC-A needs 8.5X here) and doesn't use its figures |
| Quiet zones of add-on symbols | none | Table 5-11 (7–12X before, 5X after) | not implemented |
colour
Colours are read off the rendered artwork. The red channel of sRGB, linearised, stands in for reflectance at 660 nm (src/rules/colour.ts). A spot ink's real reflectance isn't in the file.
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| Light bars on a dark background, linear codes | fail: src/rules/check.ts | ISO/IEC 15416 decode; clause not verified. GenSpecs give no clause that forbids it in these words | implemented |
| Light modules on a dark background, 2D codes | check: src/rules/check.ts | GenSpecs §5.6.2 and §5.7.3 allow reflectance reversal for GS1 DataMatrix and GS1 QR Code, so it is advice only | implemented |
| Bars reflect more than half of what the background does | fail when bar reflectance > 0.5 × space reflectance: src/rules/colour.ts | GenSpecs §5.12.5.11.1: "Rmin must always be equal to or less than half the highest reflectance value, Rmax" | implemented, on estimated reflectance |
| Background reflects under 35% of red light | fail: src/rules/colour.ts | none for the 35% figure; §5.12.5.11.1 explains that a dark background caps symbol contrast | implemented, own threshold |
| Symbol contrast under 40% | fail: src/rules/colour.ts | GenSpecs §5.12.5.10.5 and §5.12.5.11.1: 40% is the lower threshold of grade 2, and grade 1.5 is the minimum (Table 5-43) | implemented |
| Symbol contrast 40–55% | check: src/rules/colour.ts | ISO/IEC 15416 symbol contrast grade 3 threshold (55%); clause not verified | implemented |
| Saturated red or orange background | check (linear) or fail (2D): src/rules/colour.ts | none. Camera scanners use white light; this is the package's own advice | implemented, no spec basis |
| Metallic spot ink in the file, near the code's colours | check: src/rules/colour.ts | none | implemented, no spec basis |
| White spot ink in the file with a pure white background | check: src/rules/colour.ts | GenSpecs §5.12.5.11.1 names an opaque white underlay as the fix for show-through | implemented |
| Substrate opacity, gloss, laminate | none | GenSpecs §5.12.5.4 | not implemented: not in the file |
symbology
UPC-E
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| The 8 digits are the standard zero suppression of their GTIN-12 | expand, re-suppress, compare: src/rules/gs1.ts | GenSpecs §5.2.2.4.1 (encodation), §5.2.2.4.2 (decoding), §7.10 | implemented |
| Number system other than 0 | fail | GenSpecs §5.2.2.4.1: "D1 SHALL always be zero" | implemented |
ITF-14
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| Digit count | check when not 14: src/rules/gs1.ts | GenSpecs §5.3.1: fixed length, 14 digits | implemented |
| Wide-to-narrow ratio | fail outside 2.25–3.0, with 0.02 of measuring tolerance (RATIO_TOLERANCE) | GenSpecs Table 5-47 note * (2.25:1 to 3:1, target 2.5:1); §5.3.6 (a verifier passes 2.25 < N < 3.00) | implemented |
| Bearer bars present | fail when none, or when top or bottom is missing: src/rules/gs1.ts | GenSpecs §5.3.2.4: mandatory unless not technically feasible | implemented |
| Bearer bars top and bottom only | check: src/rules/gs1.ts | §5.3.2.4: a full frame is required only for printing methods that use plates | implemented |
| Bearer bar thickness | check under 2X: src/rules/gs1.ts | §5.3.2.4: at least twice the narrow bar without plates; 4.83 mm nominal with plates | partial: the 4.83 mm for plate printing isn't tested (the message says 4.8 mm) |
| 1.02 mm between bearer bar and digits | none | §5.3.2.2 | not implemented |
GS1-128 and Code 128
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| GS1 data in a Code 128 without FNC1 first | fail: src/rules/gs1.ts | GenSpecs §5.4 (FNC1 after the start character), §5.12.5.10.4 | implemented |
| A bare GTIN in plain Code 128 | fail: src/rules/gs1.ts | GenSpecs §5.4: Code 128 without FNC1 is not a GS1 carrier | implemented |
| Brackets encoded in the bars | fail: src/rules/gs1.ts | GenSpecs §5.12.5.10.4 ("absence of encoded parentheses"), §4.14 rule c | implemented |
| Data characters | fail over 48, counting each FNC1 used as a separator (the decoded text's length, separators as GS): GS1_128_MAX_CHARS | GenSpecs §5.4.4.3 | implemented |
| Length with quiet zones | fail over 165.10 mm, as symbol width + 20X: GS1_128_MAX_MM | GenSpecs §5.4.4.3: 165.10 mm | implemented |
| Element string rules | see Element strings |
GS1 DataBar
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| DataBar Limited on a pack | always check: src/rules/gs1.ts | GenSpecs §5.5.2.2, §5.5.8: not for omnidirectional POS scanners; absent from Table 5-44 | implemented |
| DataBar Expanded capacity | fail over 74 digits or 41 characters: src/rules/gs1.ts | GenSpecs §5.5.1.1, §5.5.2.3 | implemented |
| A DataBar that reads as something other than a valid GTIN-14 is dropped as a false detection | src/rules/evidence.ts | GenSpecs §5.5.2.1 | implemented |
| DataBar Limited indicator digit 0 or 1 only | none | GenSpecs §5.5.2.2 | not implemented |
| Element string rules for Expanded | see below |
GS1 DataMatrix and Data Matrix
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| GS1 data without FNC1 first | fail: src/rules/gs1.ts | GenSpecs §5.6.2, §5.6.3.3 (]d2) | implemented |
| DMRE rectangular sizes | check for any size outside the 24 squares and 6 rectangles, read as rows × columns from ZXing (gridOf, versionOf in src/zxing.ts) | GenSpecs §5.6.3.2: 24 square and 6 rectangular sizes (Tables 5-32, 5-33) | implemented |
| Rectangular sizes measured and graded on their own grid | rows × columns from ZXing (matrixGridOf in src/rules/grade.ts) | GenSpecs §5.6.3.1, §5.6.3.2 | implemented |
| Digital Link syntax in a Data Matrix | the same rules as for QR Code | GenSpecs §5.9; Table 5-46 | implemented |
QR Code and GS1 Digital Link
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| GS1 element strings without FNC1 in a QR code | check: src/rules/gs1.ts | GenSpecs §5.7.4.3 (]Q3) | implemented |
| Link scheme | check for http:// | Digital Link §3: HTTPS "recommended as best practice" | implemented |
| Primary keys, key qualifiers in the path, and their order | fail, from the dictionary's dlpkey entries: (22)/(10)/(21) or (235) after a GTIN, (8020) after (415), (8011) after (8010), (254) or (7040) after (414), (7040) after (417) and (8004), (8019) after (8017)/(8018) | Digital Link §4.3, §4.4, §4.9 | implemented |
/415/… needs /8020/… | fail | Digital Link §4.9: payTo-path = payTo-comp refNo-comp | implemented |
| Unknown keys in path or query | fail | Digital Link §4.3, §4.10 | implemented, against GS1's full AI table |
| Every value in path and query, and the rules across them | as element strings | Digital Link §4.10; GenSpecs §4.13 | implemented |
| GTIN written as 14 digits | fail for 8, 12 or 13 digits | Digital Link §4.1, §4.5 ("SHALL be prefixed with leading zeroes… 14 digits", since 1.4.0). GS1's Barcode Syntax Engine rejects the short form unless its legacy option is on | implemented |
Convenience names (gtin, lot, ser) | fail | Digital Link §4.1: removed in 1.3.0; RE1 (§6.1.1) matches AI digits only; GS1's Barcode Syntax Engine accepts them only with a switch it doesn't expose | implemented |
| Uncompressed form on retail packs | a compressed link isn't recognised as a Digital Link | GenSpecs Table 5-46 note ** | not implemented |
Element strings
Applies to GS1-128, GS1 DataBar Expanded, GS1 DataMatrix, GS1 QR Code, and the query of a Digital Link.
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| AI is known | fail when GS1 defines no such AI: aiEntry in src/rules/ai.ts, over the whole dictionary | GenSpecs §3.2, Table 3-1 (the dictionary is its machine-readable form) | implemented |
| Format, length, digits-only, per component | checkAiValue in src/rules/ai.ts: each component (N6, X..20, [N..4]…) takes its share of the data | Table 3-1 format column | implemented: (7003) N10, (8008) N8+[N..4], (8013) X..25 now as GS1 gives them |
| Content linters: check digits, check character pairs, dates (day 00 where allowed), times, zero/non-zero, piece of total, latitude, longitude, yes/no, winding, ISO 5218, position in sequence, percent-encoding | lint in src/rules/ai.ts, after GS1's reference linters (src/lint_*.c of the dictionary) | GenSpecs §7.9.1, §7.9.5, §7.12, §3.4.2; the dictionary | implemented. Linters needing a registry aren't applied: gcppos1/2, ISO 3166, ISO 4217, IBAN, importer index, media type, package type, coupon codes (NOT_APPLIED) |
| Characters allowed | set 82, set 39 for (8010) and the other Y components, base64url for (8030) | GenSpecs §7.11, Tables 7-20 and 7-21 | implemented |
| Predefined-length AIs read without a separator | the dictionary's * flag | GenSpecs §7.8.3, Table 7-6 | implemented |
| The same AI twice with different values | fail | GenSpecs §4.13.1 | implemented |
| Invalid pairs | fail, every ex= pair in the dictionary ((01)/(02), (01)/(255), (21)/(235), (8006)/(8026), (8017)/(8018)…) | GenSpecs §4.13.1, Table 4-4 | implemented |
| Mandatory associations | check, every req= in the dictionary, against the AIs of all the codes on the page (an EAN/UPC or ITF-14 counts as (01)), worded "goes with … on the same item, and no barcode on this page carries it" | GenSpecs §4.13.2, Table 4-5: on "the same physical entity", "not necessarily … in the same data carrier"; §4.13 note | implemented, as advice: the grader sees one file, not the item |
| GTIN starting with 9 needs a count, measure, roll dimensions or made-to-order variation | check without (30), a trade measure (31nn, 32nn, 35nn, 36nn), (8001) or (242) on the page | Table 4-5, rows "01 with N1 = 9"; §3.6.2 | implemented |
| Expiry before production | fail | none; plain consistency | implemented, no spec basis |
| Expiry already passed | check | none | implemented, no spec basis |
| Predefined-length AIs first; FNC1 only where needed | none | GenSpecs §7.8.3–§7.8.6, §5.12.5.10.4 | not implemented |
content
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| Digits printed under an EAN/UPC or ITF-14 differ from the bars | fail when the text found is at least as long and doesn't contain the encoded digits: src/rules/content.ts | GenSpecs §5.2.5 (all encoded digits SHALL be shown), §4.14 | partial: needs the digits as text in a PDF. Outlined text and pictures aren't read (no OCR in this package) |
| Bracketed text near a GS1-128, DataBar or GS1 2D code differs from the data | same comparison, only lines that contain an AI in brackets: src/rules/content.ts | GenSpecs §4.14 rule c (HRI follows the encoded sequence; brackets round AIs) | partial, as above |
| Nothing printed where an EAN/UPC's digits go | fail when the band under and over the bars holds no ink: src/rules/rules.ts, src/rules/measure.ts | GenSpecs §5.2.5: "SHALL be printed underneath the main symbol"; §4.14.2 | implemented for EAN/UPC only |
| HRI font, size, 0.5X gap, digit positions | none | GenSpecs §5.2.5 | not implemented |
| GTIN is all zeros | fail: src/rules/content.ts | none; a placeholder | implemented, no spec basis |
| GTIN is a known sample number | fail: list at src/rules/content.ts | none; the list is this package's own | implemented, no spec basis |
| A 13-digit number with five leading zeros | fail: src/rules/content.ts | GenSpecs §1.2.3.1, Table 1-4: 0000001–0000099 "unused to avoid collision with GTIN-8" | implemented |
| Prefix 02, 04, 2 (and GTIN-8 prefixes 0, 2): restricted circulation | check: src/rules/content.ts | GenSpecs §1.2.2.2.1; Tables 1-4, 1-5 | implemented |
| Prefix 980, 981–983, 99: refund receipts and coupons | fail | Table 1-4 | implemented |
| Prefix 05 | no finding (GS1 US, held for future use on GS1's list) | Table 1-4: 05 "used to issue GS1 Company Prefixes" | implemented |
| Prefix 984–989, and prefixes GS1's list holds for a future member organisation (610, 614, 623, 758, 894) | check: reserved | Table 1-4: 984–989 "reserved for future use"; GS1's prefix list | implemented |
| Prefix 952 | fail | Tables 1-4 and 1-5: demonstrations and examples | implemented, GTIN-8 included |
| Prefix 977, 978, 979 on a page that reads like food | fail: src/rules/content.ts, word list at | Table 1-4 (ISSN, ISBN, ISMN) | implemented; "food" is a keyword match on the PDF text |
| Prefix not in the member organisation list (140–199, 390–399…) | check: "isn't on GS1's list of prefixes allocated to member organisations" (RANGES, PREFIX_LIST_SOURCE in src/rules/symbols.ts) | GS1 prefix list, https://www.gs1.org/standards/id-keys/company-prefix, read 2026-11-27: "Prefixes not explicitly listed above are reserved by GS1 Global Office for future use". Table 1-4 puts 10–19 in the company prefix range; the list allocates 100–139 only | implemented. A GTIN-8 prefix the list doesn't name isn't flagged (the list covers GS1-8 Prefixes for 960–969 only) |
| GTIN-8 prefixes 000–099, 200–299 | check: restricted circulation within a company | Table 1-5 | implemented |
| A QR code on a page with a retail barcode opens a plain web address | check: src/rules/content.ts | none. GenSpecs §4.15.4 describes adding a 2D code beside the EAN/UPC; it doesn't require every QR code to be a Digital Link | implemented, advice only |
| A Digital Link's GTIN differs from the retail barcode on the same page | fail: src/rules/content.ts | GenSpecs §4.13.1, Table 4-4: "All occurrences of GTIN SHALL have one value" | implemented |
| The same GTIN in another product's file | check, only when the caller passes other files' GTINs: src/rules/content.ts | GenSpecs §4.2 (GTIN allocation) | library callers only; the CLI doesn't pass it |
grade
The grade is predicted from the rendered artwork, not measured on print. Reflectance is the linear red channel through a synthetic circular aperture (src/rules/grade.ts). GenSpecs §5.12.5.3 says where the method lives ("section 6 of ISO/IEC 15416", "section 5 of ISO/IEC 15415") without restating thresholds, so most threshold rows are marked clause not verified.
Linear, after ISO/IEC 15416
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| Scans | 10, evenly spaced between 10% and 90% of the bar height; symbol grade = mean: src/rules/grade.ts | ISO/IEC 15416 scan reflectance profiles, inspection band; clause not verified. GenSpecs §5.6.3.5: "the arithmetic mean ... of the scan grades" | implemented |
| Decode | pass/fail from element count and the reference decode: src/rules/grade.ts | GenSpecs §5.12.5.12; reference decode algorithms §5.2.4, §5.3.2.3, §5.4.5 | partial: the element count and decodability stand in for a full reference decode |
| Minimum reflectance | Rmin ≤ 0.5 × Rmax: | GenSpecs §5.12.5.11.1 | implemented |
| Symbol contrast | 70 / 55 / 40 / 20%: | 40% and 20% in GenSpecs §5.12.5.10.5 and §5.12.5.11.1; 70% and 55% ISO/IEC 15416, clause not verified | implemented |
| Minimum edge contrast | 15%: | GenSpecs §5.12.5.11.1 | implemented |
| Modulation | 0.70 / 0.60 / 0.50 / 0.40: | ISO/IEC 15416 modulation; clause not verified | implemented |
| Defects | 0.15 / 0.20 / 0.25 / 0.30: | ISO/IEC 15416 defects; clause not verified | implemented |
| Decodability | 0.62 / 0.50 / 0.37 / 0.25: ; EAN/UPC and Code 128 by edge-to-similar-edge, ITF and Code 39 by wide/narrow threshold: | ISO/IEC 15416 decodability; clause not verified. GenSpecs §5.12.5.10.3 (digits 1, 2, 7, 8 by bar-width sum) | partial: the Code 128 bar-sum term V2 of GenSpecs §5.4.6.2 isn't computed |
| Quiet zone as a pass/fail on each scan | the scan runs the full required quiet zone and fails decode when something is in it: | GenSpecs §5.12.5.10.3 (Table 5-63), §5.4.6.3 | partial: uses the nominal widths, not Table 5-63's |
| Aperture, EAN/UPC | 0.150 mm (ref 06): | GenSpecs Table 5-44 | implemented |
| Aperture and minimum, ITF-14 | 0.250 mm (ref 10), grade 1.5 under X 0.635 mm; 0.500 mm (ref 20), grade 0.5 from 0.635 mm: | GenSpecs §5.12.5.10.5; Table 5-47 note *** | implemented |
| Aperture and minimum, GS1-128 | 0.250 mm, grade 1.5: | GenSpecs Table 5-47 | implemented for table 2 |
| Aperture and minimum, GS1 DataBar | 0.150 mm (ref 06), grade 1.5 | GenSpecs §5.5.7 and Table 5-44: 1.5/06/660 | implemented |
| Stacked DataBar | rows found across the whole symbol, scans kept inside rows and from each row's own first bar to its last (stackedRows); grade the mean of the scans | ISO/IEC 24724; clause not verified | implemented; robust to sub-pixel shifts (test in test/coverage.test.ts) |
| Minimum for symbologies GS1 doesn't cover | reported as a fail under 1.5: src/rules/quality.ts | none | implemented, own threshold |
| Grade letters | A ≥ 3.5, B ≥ 2.5, C ≥ 1.5, D ≥ 0.5: src/rules/grade.ts | GenSpecs Table 5-43 (1.5 = C, 0.5 = D); the rest ISO/IEC 15416, clause not verified | implemented |
| Wavelength in the notation | "660": src/rules/grade.ts | GenSpecs Table 5-43: 660 nm ± 10 | implemented |
2D, after ISO/IEC 15415
Graded for QR Code and Data Matrix (squares and rectangles), on the grid ZXing states. Aztec, MaxiCode, Micro QR, rMQR, PDF417 and MicroPDF417 aren't graded: the summary says "A print-quality grade isn't predicted for this symbology" (GRADED_MATRIX).
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| Overall grade | lowest parameter grade: src/rules/grade.ts | ISO/IEC 15415 overall symbol grade; clause not verified | implemented |
| Decode | 4 when ZXing decoded it: | ISO/IEC 15415 decode | implemented, with ZXing as the decoder |
| Symbol contrast | 70 / 55 / 40 / 20%: | ISO/IEC 15415; clause not verified | implemented |
| Modulation | per-module 2 × abs(R − threshold) / SC, graded 0.50 / 0.40 / 0.30 / 0.20: | ISO/IEC 15415 modulation; clause not verified | partial: estimated from modules, not codewords |
| Fixed pattern damage | modules wrong per finder, timing or clock segment: 0 A, 1 B, 2 C, 3 D: – | ISO/IEC 15415 with ISO/IEC 18004 and 16022 annexes; clause not verified | partial: a simplified count; QR alignment patterns, format and version information aren't included |
| Axial non-uniformity | 0.06 / 0.08 / 0.10 / 0.12: | ISO/IEC 15415; clause not verified | implemented |
| Grid non-uniformity | 0.38 / 0.50 / 0.63 / 0.75 X: | ISO/IEC 15415; clause not verified | implemented |
| Unused error correction | 0.62 / 0.50 / 0.37 / 0.25: | ISO/IEC 15415; clause not verified | partial: estimated. A module near the threshold counts as one codeword in error; QR capacity is a typical share per level (), Data Matrix a flat 40% () |
| Print growth, horizontal and vertical | none | listed in the verification template of GenSpecs §5.12.7; ISO/IEC 15415, clause not verified | not implemented |
| Aperture | 0.305 mm (ref 12) for GS1 DataMatrix, GS1 QR Code and a QR or Data Matrix with a Digital Link; 80% of the measured X for other 2D codes (own choice) | GenSpecs §5.6.3.5, §5.7.4.5: "80% of the minimum X-dimension allowed for the application"; Tables 5-45 and 5-46 name ref 12 | implemented |
| Minimum grade, GS1 2D | 1.5 | GenSpecs Tables 5-43, 5-45, 5-46 | implemented, Digital Link carriers included |
print
| What is measured | Threshold in the code | Source | Status |
|---|---|---|---|
| Bar width adjustment drawn into the bars of EAN/UPC and Code 128 | stated in the summary, never judged; within 0.008 mm of whole modules counts as none (bwrNote, BWR_NONE_MM); measured by barWidthReduction | GenSpecs §5.12.4.2.1 describes bar width adjustment, set from a press test and tied to X; it gives no figures | implemented |
| Against a named print process | none: the process is a label in the summary. The print rule id is no longer emitted | no citable public source for per-process figures; see Bar width reduction | removed |
Not covered
GS1 rules that matter to artwork and that the code doesn't check.
| Rule | Source |
|---|---|
| Placement on the pack: number of barcodes, back-of-pack quadrant, 8 mm and 100 mm edge rule, package-type rules | GenSpecs §6.2–§6.4, §6.3.3.3 |
| Orientation: picket fence or ladder, and on curved surfaces | GenSpecs §6.2.3 |
| Placement on cartons and pallets, the GS1 Logistic Label layout | GenSpecs §6.6, §6.7 |
| Add-on symbols: size, quiet zones, separation, digits above (their digits are read and reported, not checked) | GenSpecs §5.2.2.5, §5.2.3.6, Table 5-11, Table 5-44 |
| Composite components (CC-A, CC-B, CC-C) | GenSpecs §5.11 |
| GS1 DotCode | GenSpecs §5.8 |
| Choosing the symbol specification table for the application (tables 2–13) | GenSpecs §2.7, §5.12.2.6, Figures 5-67 and 5-68 |
| HRI font, size, position and the 0.5X gap; HRI text for GS1 2D codes on retail packs | GenSpecs §5.2.5, §4.14, §4.14.2 |
| Colour of the HRI text | not a GS1 rule found in Release 26.0; not checked either |
| Two barcodes side by side for the move to 2D: adjacency and spacing | GenSpecs §4.15.1, §4.15.4 |
| EAN/UPC 1/13-module adjustment of digits 1, 2, 7, 8 | GenSpecs §5.2.3.1, Table 5-10 |
| Length of an EAN/UPC symbol with quiet zones (113X and the rest) | GenSpecs §5.2.3.5, Table 5-12 |
| Print process characterisation, press proofs, substrate | GenSpecs §5.12.4, §5.12.5.4, §5.12.6 |
| Direct part marking | GenSpecs §5.12.4.3, Table 5-53 |
| Healthcare, tobacco and durable-marking tables | GenSpecs Tables 5-52 to 5-59 |
Where the code differs from the spec
The differences found when this page was first written (GTIN-9 and association rules, the AI table, Digital Link 1.7.0, DataBar heights and grades, 2D apertures and sizes, UPC-E, ITF-14 ratio, GS1-128 length, prefixes, rectangular Data Matrix, the other 2D symbologies, Code 93 and PDF417 X, add-ons, the ITF-14 name, the grade/print rule id) are fixed; the rows above say how. What still differs or is this package's own:
| Where | What the code does | What the spec says |
|---|---|---|
NEAR_MIN in src/rules/check.ts | advice under 90% of the EAN/UPC target | GS1 gives no such figure; §5.12.2.4 says to consult the printer |
src/rules/colour.ts | 35% background reflectance and the saturated-red advice | own thresholds |
NOT_APPLIED in src/rules/ai.ts | registry linters (company prefix position, country, currency, IBAN…) not applied | the dictionary applies them |
PHOTO_BELOW in src/rules/photo.ts | a close-up under 60% on its four main tones is a photo, and its tones, clear space and grade aren't judged | own measurement; figures in rules |
src/rules/check.ts | Rule id read is declared, never emitted; so is print since the per-process judgement was removed |