papandreou / node-pngquant

The pngquant utility as a readable/writable stream
BSD 3-Clause "New" or "Revised" License
82 stars 23 forks source link

Change pngquant-bin to an Optional Dependency #16

Closed trisys3 closed 6 years ago

trisys3 commented 6 years ago

From what I can tell, it seems like the only reason for pngquant-bin to be here is if pngquant is not installed. That's fine, but the post-install script for pngquant-bin doesn't always complete, even when pngquant can in fact be installed. My example is the termux app, which is admittedly a niche case, but I'm sure there are others. termux is on android, meaning ARM. I'm not positive that's the case, it might be an old version of pngquant, but regardless the pngquant-bin version doesn't build, but there is a system version that does.

If pngquant-bin can't be installed but the system pngquant is already installed, this package still fails. This package is depended on by a whole lot of other packages, like webpack's img-loader package and all the grunt and gulp image minifier packages.

There are plenty of issues on the pngquant-bin package related to this issue, like one about trying the system package before using one of its pre-built versions. However, all of them seem to have stalled. I am proposing adding pngquant-bin as an optional dep as more of a stop-gap measire than anything else.

papandreou commented 6 years ago

Hey, thanks for getting in touch!

Hmm, pngquant-bin is already an optional dependency. Seems like it has been like that since v0.1.4 (released 2014): https://github.com/papandreou/node-pngquant/commit/14bce2746fd2d16b8802f25a72f2e38a39822880

Could you show an example of pngquant failing to install?

trisys3 commented 6 years ago

Hmmm... you're right. Sorry, I think I got my packages confused. I was looking for the imagemin-pngquant package, which does have pngquant-bin as a non-optional dependency. Will close.