papandreou / node-pngquant

The pngquant utility as a readable/writable stream
BSD 3-Clause "New" or "Revised" License
82 stars 23 forks source link

pass config #9

Closed ckrad closed 5 years ago

ckrad commented 8 years ago

how can i pass config? i pass ['--quality=60'] it not work

streamifier.createReadStream(data).pipe(new PngQuant(['--quality=60']))
papandreou commented 8 years ago

If that's a valid switch, it should work. You could also try ['--quality', 60], does that help?

ckrad commented 8 years ago

i tried but not work

papandreou commented 8 years ago

Could you try adding a test based on eg. https://github.com/papandreou/node-pngquant/blob/master/test/PngQuant.js#L17-L26 that demonstrates the problem?

perryh commented 7 years ago

This issue is old but if anyone is curious, here is how you can pass in configs:

const pngQuanter = new PngQuant(['--quality', '70-90', '-']);

Last hyphen is used for reading and writing from stdin and stdout.

papandreou commented 5 years ago

Should be addressed by #12.