gifcap icon indicating copy to clipboard operation
gifcap copied to clipboard

Publish gif encoder to npm?

Open mattbierner opened this issue 5 years ago • 2 comments

Hey Joao, nice work on gifcap! I have a few project that need to save gifs from user generated content and it seems like gifcap's encoder has the best performance of the ones I've tested and also produces by far the best looking gifs. Do you have any plans to publish the encoder part of this project so that others could also benefit from it?

If not, any objections to me bundling up the the encoder and publishing it to npm?

mattbierner avatar May 27 '20 01:05 mattbierner

Yeah the encoder is pretty kick ass, thanks! I can look into publishing it. For now, do you mind inlining it in your projects, until I get it into npm?

joaomoreno avatar May 27 '20 08:05 joaomoreno

Thanks. Inlining the encoder works fine so no rush publishing to nom (I'll include a link the readme for my project back to gifcap).

Here's the (potentially incorrect) d.ts file I've been using to support using the encoder from TypeScript:

declare class GifEncoder {
    constructor(options: {
        width: number,
        height: number
    });

    dispose(): void;

    on(channel: 'progress', callback: (progress: number) => void): void;
    once(channel: 'finished', callback: (blob: Blob) => void): void;

    abort(): void;
    render(): void;

    addFrame(imageData: ImageData, delay: number): void;
}

mattbierner avatar May 27 '20 18:05 mattbierner