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 id | What it covers | Levels it can report |
|---|---|---|
| checkDigit | the last digit of a GTIN or SSCC doesn't match the rest | fail |
| size | the symbol is smaller or larger than GS1 allows where it is scanned | fail |
| barHeight | the bars are shorter than the symbol's size needs | fail, check |
| quiet | something sits in the clear space around the symbol | fail |
| colour | bars and background don't contrast in a scanner's red light, or the code is reversed | fail, check |
| symbology | a rule of one symbology: UPC-E, ITF-14, GS1-128, GS1 DataBar, GS1 DataMatrix, QR, GS1 Digital Link | fail, check |
| content | what the code says against the pack: digits under the bars, prefix, other codes | fail, check |
| grade | the predicted ISO/IEC 15416 or 15415 grade is under the minimum | fail |
| reserved: declared, no longer reported (the bar width adjustment is stated in the summary, not judged) | none | |
| read | reserved: declared, never reported today | none |
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:
| Set | Codes | Share on the four main tones |
|---|---|---|
| photographs of packs (a private set of Open Food Facts photos) | 22 | 0.19–0.49 |
| the benchmark corpus (vector and raster artwork, blurred and low-contrast ones included) | 374 | 0.73 and above |
| real label PDFs (private) | 17 | 0.73 and above |
| real GS1 guideline PDFs (private) | 33 | 0.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.