Skip to content

readPngDimensions

Reads a PNG’s pixel dimensions from its IHDR header.

The whole point is verification: a capture that silently comes back at the wrong size is the failure mode that produces an off-spec screenshot set, so the size is read back from the bytes rather than assumed from the request.

Import:

import { readPngDimensions } from 'obsidian-integration-testing';

Signature:

function readPngDimensions(bytes: Uint8Array<ArrayBufferLike>): PngDimensions

Parameters:

ParameterTypeDescription
bytesUint8Array<ArrayBufferLike>The PNG bytes.

Returns: PngDimensions — The image’s width and height in pixels.