png-compressor
    Preparing search index...

    Interface IDecodedPng<T>

    A png that has been successfully decoded.

    interface IDecodedPng<T extends IImage32 | IImage64> {
        details: IPngDetails;
        image: T;
        info: string[];
        metadata: PngMetadata[];
        palette?: IPngPalette;
        rawChunks: IPngChunk[];
        warnings: DecodeWarning[];
    }

    Type Parameters

    Index

    Properties

    details: IPngDetails

    Details about the image, this is mostly useful internally as they are used to decode the image. However, these could be presented in an image viewer.

    image: T

    The image dimensions and data.

    info: string[]

    Any informational messages when decoding. These are things of note but not important enough to be a warning.

    metadata: PngMetadata[]

    A list of metadata entries that have been decoded. See IDecodePngOptions.parseChunkTypes for how to decode additional metadata entries.

    palette?: IPngPalette

    The palette if it exists.

    rawChunks: IPngChunk[]

    All raw chunks contained in the png.

    warnings: DecodeWarning[]

    Any warnings that were encountered during decoding. Warnings typically fall into the following categories and are generally safe to ignore:

    • Strict ordering of chunks is not respected.
    • Invalid property values in ancillary chunks.
    • Could not decode an ancillary chunk.
    • CRC checksum check for the chunk failed.
    • Unrecognized chunk type (this is always a warning regardless of strict mode).
    • Mutually exclusive chunk types were both included (eg. sRGB and iCCP).

    Strict mode can be enabled via IDecodePngOptions.strictMode which will throw an error when any warning is encountered.