Skip to content

Rules ​

Every issue in a report carries a rule id in issues[].rule. These are all of them, taken from the Rule type in src/rules/check.ts.

Rule idWhat it coversLevels it can report
checkDigitthe last digit of a GTIN or SSCC doesn't match the restfail
sizethe symbol is smaller or larger than GS1 allows where it is scannedfail
barHeightthe bars are shorter than the symbol's size needsfail, check
quietsomething sits in the clear space around the symbolfail
colourbars and background don't contrast in a scanner's red light, or the code is reversedfail, check
symbologya rule of one symbology: UPC-E, ITF-14, GS1-128, GS1 DataBar, GS1 DataMatrix, QR, GS1 Digital Linkfail, check
contentwhat the code says against the pack: digits under the bars, prefix, other codesfail, check
gradethe predicted ISO/IEC 15416 or 15415 grade is under the minimumfail
printreserved: declared, no longer reported (the bar width adjustment is stated in the summary, not judged)none
readreserved: declared, never reported todaynone

fail means "will likely fail"; check means "check this". A code's verdict is fail if any issue is a fail, check if it has issues and none is a fail, ok otherwise (src/rules/check.ts).

The clause behind each threshold is in the spec map.

Photos of printed packs ​

A close-up that looks like a photo of a printed pack is read for what it encodes, and its tones, clear space and predicted grade are not judged: they are the camera's, not the artwork's (report.photo, src/rules/photo.ts). It is a photo when the image's EXIF names a camera, or when under 60% of its pixels sit on its four main grey tones (each tone a grey level and the two either side). Artwork, drawn by a renderer or exported from a design tool, is flat: a few inks and paper, often more than two (a tinted panel behind a white box, a second ink). A photo's pixels spread.

The 60% line was set from two sets of close-ups measured on 27 November 2026:

SetCodesShare on the four main tones
photographs of packs (a private set of Open Food Facts photos)220.19–0.49
the benchmark corpus (vector and raster artwork, blurred and low-contrast ones included)3740.73 and above
real label PDFs (private)170.73 and above
real GS1 guideline PDFs (private)330.57 and above; the one under 0.60 is a low-resolution raster image placed in the PDF, and is treated as a photo

The earlier test (two tones, under 0.60) called three flat corpus files photos (trim-ean13-15.pdf, carton-qr-across-fold.pdf, carton-qr-centre.pdf, three-tone vector artwork) and skipped their checks; it now calls none of the 374 a photo and still calls all 22 photographs photos.

MIT licensed. It predicts from the artwork; it is not a verifier.