tinyimg - v1.0.0
    Preparing search index...

    Interface TransformResult

    The result of a one-shot transformation.

    Carries the bytes and the conveniences a Worker actually wants, so nobody has to build a Response or a data: URL by hand.

    interface TransformResult {
        contentType: string;
        data: Uint8Array<ArrayBuffer>;
        flattened: boolean;
        format: ImageFormat;
        height: number;
        width: number;
        blob(): Blob;
        bytes(): Uint8Array<ArrayBuffer>;
        dataUrl(): string;
        response(headers?: HeadersInit): Response;
    }
    Index
    contentType: string

    Its content type.

    data: Uint8Array<ArrayBuffer>

    The encoded image.

    flattened: boolean

    Set when the source held several frames and this output holds only the first.

    There is no animated encoder, so any request that actually has work to do reduces an animation to a still. That is a lossy outcome a caller may want to avoid rather than discover, by serving the original or by asking for a request that passes through.

    format: ImageFormat

    What it was encoded as.

    height: number

    Height of the output in pixels.

    width: number

    Width of the output in pixels.

    • The encoded bytes.

      Returns Uint8Array<ArrayBuffer>

    • The bytes as a Response, typed and length-set.

      Parameters

      • Optionalheaders: HeadersInit

      Returns Response