iya-sts
    Preparing search index...

    Rewrites a JPEG, PNG or WebP without its metadata. A static utility class; it holds no state.

    Index
    PNG_KEPT: readonly string[] = PNG_KEPT
    WEBP_KEPT: readonly string[] = WEBP_KEPT
    • One RIFF chunk written out, padded to an even length.

      Parameters

      • name: string

        its four characters

      • payload: Buffer

        its data

      Returns Buffer

      the chunk's bytes

    • The RIFF chunks between two offsets, as [fourcc, payload] pairs.

      Parameters

      • b: Buffer

        the bytes

      • from: number

        the first chunk's offset

      • to: number

        where the chunks end

      Returns [string, Buffer][]

      the chunks, or null when one runs past to

    • The file as it will be kept, or null when it cannot be rewritten.

      Parameters

      • bytes: Buffer

        the file

      • type: string

        its type, as the bytes decided it (image/jpeg, image/png or image/webp)

      Returns any

      the rewritten file, or null for a file that cannot be walked or a type with no writer

    • A JPEG with its metadata segments and anything after its end removed.

      APP0 (JFIF), an APP2 ICC profile and APP14 stay; every other application segment and every comment goes. A file that is not walkable to the end of its image answers null.

      Parameters

      • b: Buffer

        the file, starting with the SOI marker

      Returns any

      the rewritten file, or null

    • A PNG holding only the chunks in PNG_KEPT, and nothing after IEND.

      Parameters

      • b: Buffer

        the file, starting with the PNG signature

      Returns any

      the rewritten file, or null when it does not walk to IEND

    • A WebP holding only the chunks in WEBP_KEPT, its EXIF and XMP flags cleared, and nothing after its RIFF size.

      Parameters

      • b: Buffer

        the file, starting with RIFF....WEBP

      Returns any

      the rewritten file, or null when it cannot be walked or holds no image