jnordberg / gif.js

JavaScript GIF encoding library
http://jnordberg.github.io/gif.js/
MIT License
4.74k stars 668 forks source link

"running" is never set to "false" #128

Open jumpjack opened 3 years ago

jumpjack commented 3 years ago

The only method setting "running" variable to "false" (after "render()" sets it to "true") is "abort()"; I think render() should set running to false once finished.

mrrs878 commented 3 years ago

I did this: call gif.abort() in the callback function of gif.on("finished") and then running is reset to false

Omiod commented 3 years ago

To properly launch multiple time the gif rendering without issues, I had to do the following: gif.abort(); gif.frames = []; delete gif.imageParts; delete gif.finishedFrames; delete gif.nextFrame;

mrrs878 commented 3 years ago

Yes, I found that there would be problems when rendering a new gif after calling gif.abort(), so I replaced gif.abort() with

// ...
gif.running = false;
gif.frames = [];
// ...