QR codes
The code an invoice, a boarding pass or a label ends up wanting, drawn into the document rather than fetched as a picture and pasted in.
A barcode that does not scan stops the pallet at the door and the queue at the till. It fails for reasons nobody can see by looking — a check digit one out, bars a shade too thin because the code was saved as a picture and then resized, a white margin somebody trimmed off to make it fit.
Two different jobs sit on the same page here. Code 128 takes any text at all — a works order, a batch number, a shelf reference — and packs it into the narrowest strip that text allows. The retail three are the opposite: EAN-13, UPC-A and EAN-8 each carry a fixed count of digits and nothing else, because a till reads them and a till expects exactly that. Their last digit is not one you pick either — it is worked out from the ones in front of it, and a wrong one is the commonest reason a code is turned away at a checkout. Stripes like these are the choice when the thing reading them is a laser at a counter or a loading bay; when the message is longer than a number, the square codes further along this family carry far more.
Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.
Read the Rust source Read the Python source Read the JSON source
The code an invoice, a boarding pass or a label ends up wanting, drawn into the document rather than fetched as a picture and pasted in.
The code industry marks small parts with: still readable at sizes where a QR code has given up, on a circuit board or a phial in a laboratory tray.
The code on identity documents and shipping papers: it carries far more text than a row of bars, and it survives a laser scanner dragged across it.
The code on rail and airline tickets, and the reason is room: it needs no band of white around it, which is the first thing trimmed off a layout that has run tight.
The four picture formats read — JPEG, PNG, BMP and TIFF — shown across every picture shipped with the library, each captioned with what its own file declares.
A file of three sheets and a file holding one photograph, each picture on a page cut to its own size; the photograph goes in exactly as the camera wrote it, since reading software reads a photograph itself.