Skip to content

Commit

Permalink
Fix issue with pngquant and exit code 99 (#71)
Browse files Browse the repository at this point in the history
Co-authored-by: Dave Thompson <[email protected]>
Co-authored-by: Sindre Sorhus <[email protected]>
  • Loading branch information
3 people authored Sep 9, 2020
1 parent 0754402 commit c8e1546
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ const imageminPngquant = (options = {}) => input => {
const promise = subprocess
.then(result => result.stdout) // eslint-disable-line promise/prefer-await-to-then
.catch(error => {
if (error.code === 99) {
// We use `error.exitCode` to check for a special condition when running the pngquant binary.
// See details on handling of "99" code at https://pngquant.org (search for "status code 99").
if (error.exitCode === 99) {
return input;
}

Expand Down

0 comments on commit c8e1546

Please sign in to comment.