I came accross cwebp-bin
come from webpack's plugin image-webpack-loader
. Once I enabled WEBP in that plugin, I started getting errors such as:
Error: PNG support not compiled. Please install the libpng development package before building.
Error: JPEG support not compiled. Please install the libjpeg development package before building.
Those errors come from the cwebp
binary located in the cwebp-bin/vendor
folder.
When cwebp-bin
installed, the pre-build check failed and compilation took place --successfully. Looking at the install script cwebp-bin/lib/install.js
, I can see that it just calls configure
and make
on the source distribution. As stated, this works; but it does not help a lot, since it builds a binary without support for any legacy file format (png, jpeg, tiff, gif): The WEBP documentation states:
Preparing the Platform
Linux
Install the libjpeg, libpng, libtiff and libgif packages, needed to convert between JPEG, PNG, TIFF, GIF and WebP image formats.
Package management varies by Linux distribution. On Ubuntu and Debian, the following command will install the needed packages:
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev
Complete the installation (see below).
Mac OS X
. . . . . . . . . .
Trying to automate the compilation for all platforms sounds like a drag. How about replacing the build process with a simple fetch + extract of the appropriate binary package? Or even better include the binaries in the cwebp-bin
repo to remove the direct dependency to Google?
We would then hit issues #11 on platforms where dynamic linking is used for precompiled binaries. I am not sure why that issue was closed: imho cwebp-bin
should at the very least document the dependency in the README and warn during the installation that it is not met (when applicable, i.e. when NOT compiling from source AND when dynamic linking is used).
Finally, I think that issue #27 would also be addressed with the above.