Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(issue with upstream/pngquant bin?) Process exits with error #32

Closed
strarsis opened this issue Dec 23, 2016 · 1 comment
Closed

(issue with upstream/pngquant bin?) Process exits with error #32

strarsis opened this issue Dec 23, 2016 · 1 comment
Labels

Comments

@strarsis
Copy link

strarsis commented Dec 23, 2016

PNG images outputted from node sharp are piped into pngquant for lossy and advanced optimisations.

An error occurs when the quality string for pngquant contains a too narrow range (e.g. '80-90'):

events.js:141
      throw er; // Unhandled 'error' event
      ^
Error: Command failed: /home/user/test/node_modules/pngquant-bin/vendor/pngquant --output /tmp/06882c02-6fe8-41d9-b706-3e8ab3eb2f17 /tmp/13322606-798c-4f90-b540-e384134c9280 --quality 90-100 --speed 3

    at /home/user/test/node_modules/execa/index.js:170:11
    at process._tickCallback (node.js:385:9)
[...]

Gulp and the node process completely exits prematurely.

Edit: According to caught error, pngquant binary exited with code 99, which is described here: https://github.com/pornel/pngquant#--quality-min-max
This module should handle the error, emit an info or warning but not fail like it does currently.

shinnn referenced this issue Jan 12, 2017
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 #21)
@shinnn shinnn added the bug label Jan 12, 2017
@shinnn
Copy link
Contributor

shinnn commented Jan 12, 2017

Thanks for the report, @strarsis. Do you have interest in submitting a pull request? Maybe checking the exit code in L54-L57 like 213b093 solves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants