mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-15 01:59:57 +00:00
* Add LTO for C++ builds This didn't have much effect on fastcomp builds, but provides further size savings with new LLVM backend we switched to in #750 (and fixes the MozJPEG size regression from the same PR). In the future we won't need to pass `--llvm-lto 1` explicitly, but latest Emscripten Docker image doesn't contain the Emscripten version with the necessary fixes for this. * Delete build.log Co-authored-by: Jake Archibald <jaffathecake@gmail.com>
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.