This makes building simpler and allows us to potentially use multithreading version in the future.
For now points to a custom fork of OxiPNG that enables WebAssembly support, as PR is still pending review.
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
This delegates loading of Wasm modules to Webpack itself, making wrapper code simpler.
Emscripten-generated modules are still using custom loading glue as they're not compatible with Webpack.
Nightly is no longer necessary for wee_alloc, so we don't need to rely on unstable versions of Rust anymore.
As a bonus, this reduces size of each Rust-related Docker image by >1 GB:
- `squoosh-rotate`: 2.94GB -> 1.87GB
- `squoosh-resize`: 3.09GB -> 2.02GB
- `squoosh-hqx`: 3.13GB -> 2.06GB
* Scaling works on native
* It works in wasm
* Integrate with UI
* Remove benchmark
* Integrate Hqx into Resizer module
* Link against repo for hqx
* Remove unused defaultOpts
* Re-add test file
* Adding size dropdown
* Chrome: go and sit on the naughty step
* Better docs
* Review
* Add link to crbug
* Update src/codecs/processor-worker/index.ts
Co-Authored-By: Jake Archibald <jaffathecake@gmail.com>
* Terminate worker inbetween resize jobs
* Add sRGB -> RGB conversion before resize
* Add clamping for color space conversions
* Clip for demultiplication as well
* Fixing linear <-> srgb conversion
* Update benchmark
* Decouple srgb calculations
* Generate lookup tables
* Update src/codecs/resize/options.tsx
* Defaulting on, renaming, removing redundant state
* Implement alpha premultiplication
* Add benchmark to resize
* Only display "Premultiply alpha" if it's one of the rust resize types.
* Add comment about division by zero
* Adding chroma subsampling for mozjpeg
* Adding separate chroma quality.
* Preact sometimes removes the inline styles, this fixes it.
* Simplifying chroma subsample
* Adding comments