checkPng

Checks recognizable PNG dimensions and inflates image data into a fixed scratch buffer before native decoding. No decoded pixels are retained, and malformed PNG data or excessive expansion fails before native allocation. Other encoded formats return false and remain subject to a decoder's own format and allocation contract.

Return

true for a PNG whose preflight completed, or false when the PNG signature is absent.

Parameters

bytes

caller-owned encoded bytes, read synchronously without retaining them.

Throws

when recognizable PNG data is malformed or a ceiling is exceeded.