From 213b0934a39d2711df5333d03148a83b1204d292 Mon Sep 17 00:00:00 2001 From: Shinnosuke Watanabe Date: Fri, 19 Feb 2016 17:54:11 +0900 Subject: [PATCH] Allow pngquant's special exit code https://github.com/pornel/pngquant/blob/6827a99fb9447abb6e2b58ab00f098f5106f8f88/README.md#--quality-min-max > If conversion results in quality below the `min` quality the image won't be saved (if outputting to stdin, 24-bit original will be output) and pngquant will exit with status code 99. (Fix https://github.com/imagemin/imagemin-pngquant/issues/21) --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index bf4aa36..6df4bbe 100644 --- a/index.js +++ b/index.js @@ -75,7 +75,7 @@ module.exports = function (opts) { }); cp.on('close', function (code) { - if (code) { + if (code && code !== 99) { err = new Error(err); err.fileName = file.path; cb(err);