Skip to content

Commit

Permalink
Also default the command line args to [256] when an empty array is pa…
Browse files Browse the repository at this point in the history
…ssed to the constructor.
  • Loading branch information
papandreou committed Dec 1, 2012
1 parent 1856578 commit c6a6737
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/PngQuant.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ var childProcess = require('child_process'),
function PngQuant(pngQuantArgs) {
Stream.call(this);

if (!pngQuantArgs || pngQuantArgs.length === 0) {
pngQuantArgs = [256];
}

this.writable = this.readable = true;

this.pngQuantProcess = childProcess.spawn('pngquant', pngQuantArgs || [256]);
this.pngQuantProcess = childProcess.spawn('pngquant', pngQuantArgs);

this.hasEnded = false;

Expand Down

0 comments on commit c6a6737

Please sign in to comment.