-
Notifications
You must be signed in to change notification settings - Fork 23
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
Added possibility to set binary path of pngquant manually #10
Conversation
@@ -22,6 +22,11 @@ function PngQuant(pngQuantArgs) { | |||
util.inherits(PngQuant, Stream); | |||
|
|||
PngQuant.getBinaryPath = memoizeAsync(function (cb) { | |||
if(this.binaryPath !== undefined) { | |||
cb(this.binaryPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You seem to be releasing Zalgo here by calling the callback immediately. Also, it should be cb(null, this.binaryPath);
so this.binaryPath
isn't interpreted as an error.
Thanks for the contribution! I'm cool with the feature, but have a quibble with the implementation -- se my comment :) |
Sorry for the mistakes, hope I fixed them now. Is this ok to merge now or are there still things that need a fix? |
👍, merging. |
Released as 1.1.0, thanks! |
Added possibility to set binary path of pngquant manually. Pretty useful when using this tool and if you want to hijack the command line with for instance a Docker container. This would also make it possible to use a specific version (or fork) of pngquant on a system where multiple versions are installed.