gif.js icon indicating copy to clipboard operation
gif.js copied to clipboard

Stop/Destroy GIF objects while rendering

Open takempf opened this issue 11 years ago • 3 comments

Is there any way to stop/destroy a GIF while it's rendering? Something like:

gif = new gifjs.GIF({
    workers: 8,
    quality: options.quality,
    repeat: 0,
    width: options.width,
    height: options.height,
    workerScript: chrome.runtime.getURL('scripts/vendor/gif.worker.js')
});

// add frames here
gif.addFrame(...

gif.render();

// oh god this is taking too long please help
gif.stop(); // or gif.destroy();

takempf avatar Nov 02 '14 03:11 takempf

There's currently no way to abort a frame in progress, it will only stop enqueuing new frames.

jnordberg avatar Nov 02 '14 04:11 jnordberg

gif.abort() isn't mentioned in the documentation

1j01 avatar Nov 02 '14 18:11 1j01

Thanks, @1j01 that's what I was looking for. I'd love to see this documented.

takempf avatar Nov 10 '14 01:11 takempf