Atrium — shared contracts and the typesetting engine
    Preparing search index...

    Function placeImage

    Images (landed). decodeImage and imageStream are the two halves — bytes to an intrinsic size, and that size to a PDF XObject description — and both are exported because they are separately testable and separately useful: a caller can ask how big a figure is without laying out a document.

    • THE SEAM. One image, placed: an HBox of the requested size holding whatever node kind carries the embedded picture, or null when it could not be placed at all.

      Returning an HBox rather than appending to a list is deliberate: an image is horizontal material, so it takes part in line breaking exactly like a word, and a box is the only thing the line breaker needs from it.

      The box has zero depth: LaTeX sets a graphic sitting on the baseline, so its whole extent is height and a line containing one is as tall as the picture. Its width/height are the placed size, so line breaking and the overfull-box check see the real thing.

      image is never mutated — the document model is laid out up to three times and each pass must read exactly what the first did. Everything derived here (the resolved file name, the decoded size, the placed size) is recomputed per pass from ctx, which is the only thing that can differ between them.

      Every failure is one Diagnostic per bad file per pass, attributed to the \includegraphics that asked for it: ctx.reported is the latch, and layout/vlist.ts hands the same set to every call in a pass.

      Parameters

      Returns HBox | null