Skip to content

isPng

Decides whether the given bytes are a PNG carrying an IHDR chunk.

Used to fail a capture loudly when a transport hands back something that is not an image, rather than writing a corrupt file to disk.

Import:

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

Signature:

function isPng(bytes: Uint8Array<ArrayBufferLike>): boolean

Parameters:

ParameterTypeDescription
bytesUint8Array<ArrayBufferLike>The bytes to check.

Returns: booleantrue when the bytes are a PNG.