mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-15 01:59:57 +00:00
Benefits:
- newer versions of the libraries
- zlib: 1.2.8 -> 1.2.11
- libpng: 1.6.18beta04 -> 1.6.34
- much fewer dependencies to install (as libs are already in optipng archive and we don't need napa)
- much smaller build thanks to customised versions of zlib and libpng containing only APIs necessary for optipng itself: 238950 -> 177359 bytes
- much faster build thanks to preconfigured libpng and stripped APIs: 2m15s -> 40s
- much simpler build script: 77 -> 46 lines
Codecs
This folder contains a self-contained sub-project for each encoder and decoder that squoosh supplies.
Build
Each subproject can be built using Docker the following commands:
$ npm install
$ npm run build
This will build two files: <codec name>_<enc or dec>.js and <codec name>_<enc or dec>.wasm. It will most likely be necessary to set Module["locateFile"] to successfully load the .wasm file. When the .js file is loaded, a global <codec name>_<enc or dec> is created with the same API as an Emscripten Module.
Each codec will document its API in its README.