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

options.background not work

Open gera2ld opened this issue 8 years ago • 4 comments

options.background not work, there is no such property: ctx.setFill.

Ref: https://github.com/jnordberg/gif.js/blob/060595539daeec3cf919754cee398ba0b3ef57f4/src/gif.coffee#L170

gera2ld avatar Aug 31 '16 08:08 gera2ld

https://github.com/jnordberg/gif.js/pull/46

1j01 avatar Aug 31 '16 23:08 1j01

var encoder = new GIFEncoder(878,759); encoder.repeat = 0; encoder.delay = 10; encoder.quality = 10; encoder.background = 0xFFFFFF; encoder.setTransparent(0xFFFFFF); pngFileStream('out/goat/Armature-goat_eat_anim_?.png') .pipe(encoder.createWriteStream({})) .pipe(fs.createWriteStream('out/goat_eat.gif')) my code is like this,but the background is still black color. It looks like "background" and "transparent" do not work.

sucresk avatar Mar 14 '17 02:03 sucresk

ctx.setFill = @options.background in gif.coffee should be: ctx.fillStyle = @options.background I'd submit a pull request except I don't know how. You could just change setFill to fillStyle in gif.js.

jormaturkenburg avatar May 10 '17 14:05 jormaturkenburg

The fix proposed by @jormaturkenburg seems the right way to handle this. Do you have any plan for updating the library, please?

edouardmercier avatar Sep 07 '18 07:09 edouardmercier