Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Imagemin.prototype._optimizePng = function () {
var args = ['-strip', 'all', '-quiet'];
var optipng = require('optipng-bin').stream;
var pngquant;
if (typeof this.optimizationLevel === 'number') {
args.push('-o', this.optimizationLevel);
}
if (this.opts.pngquant) {
pngquant = require('pngquant-bin').path;
return spawn(optipng, args).stdout.pipe(spawn(pngquant, ['-']));
}
return spawn(optipng, args);
};