Images on a page
A photograph that goes in exactly as it came out of the camera, and one with transparent parts that keeps them, each on a page cut to its own size.
A picture that comes from outside rarely has the proportions of the rectangle it has to go in. Stretched to fill the rectangle, it loses its proportions; kept at its own size, it leaves empty space around it or runs past the edge. That choice comes up again with every catalogue and every report you produce.
So the decision is made once and named: fit the whole picture inside, or fill the rectangle and let the edges be cut, or stretch it and accept the distortion, or leave it at the size it came. The same picture is shown here under eight such rules in a rectangle of one size — stood against an edge, given a margin, turned a quarter, turned by an angle, mirrored — and nothing on the page was measured by hand. Only the one that fills its rectangle overflows, and it is cut at the edge, on purpose.
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 document is lighter than it was, and every page still looks exactly the same. See this document's row in the table of every example.
A photograph that goes in exactly as it came out of the camera, and one with transparent parts that keeps them, each on a page cut to its own size.
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.
Stripes for the two jobs that want them: Code 128 for any text at all, and the three a till reads — EAN-13, UPC-A, EAN-8 — each with its last digit worked out rather than typed.
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.