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

    Function decodeImage

    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 OTHER HALF OF THE SEAM, split out because pdf/render.ts needs it too: bytes in, intrinsic size out, with no page design involved.

      Diagnostics are attributed to the image file, whole-file, because that is the only position this function knows; every message names path, and placeImage re-homes them onto the \includegraphics line. Returns null after reporting an error; never throws.

      Parameters

      • bytes: Uint8Array
      • path: string
      • diagnostics: {
            code?:
                | "syntax"
                | "unsupported"
                | "undefined-command"
                | "undefined-environment"
                | "undefined-reference"
                | "duplicate-label"
                | "missing-file"
                | "missing-font"
                | "overfull-box"
                | "underfull-box"
                | "budget-exceeded"
                | "limit-exceeded"
                | "stopped"
                | "internal";
            column?: number;
            construct?: string;
            file: string;
            line: number;
            message: string;
            severity: "error"
            | "warning"
            | "info";
        }[]

      Returns DecodedImage | null