Skip to content

Make images smaller using best-in-class codecs, right in the browser.

JavaScript

Use UNALIGNED_ACCESS_IS_FAST for OxiPNG -> libdeflate

Ingvar Stepanyanc7d156e8d78c
diff --git a/codecs/oxipng/build.sh b/codecs/oxipng/build.sh
index 0f2536fa..200481fb 100755
--- a/codecs/oxipng/build.sh
+++ b/codecs/oxipng/build.sh
@@ -3,6 +3,7 @@
set -e
rm -rf pkg,{-parallel}
+export CFLAGS="${CFLAGS} -DUNALIGNED_ACCESS_IS_FAST=1"
wasm-pack build -t web
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory' wasm-pack build -t web -d pkg-parallel -- -Z build-std=panic_abort,std --features=parallel
# Workaround https://github.com/rustwasm/wasm-bindgen/issues/2133:
diff --git a/codecs/oxipng/pkg-parallel/squoosh_oxipng_bg.wasm b/codecs/oxipng/pkg-parallel/squoosh_oxipng_bg.wasm
index a90f2296..49fe70f3 100644
Binary files a/codecs/oxipng/pkg-parallel/squoosh_oxipng_bg.wasm and b/codecs/oxipng/pkg-parallel/squoosh_oxipng_bg.wasm differ
diff --git a/codecs/oxipng/pkg/squoosh_oxipng_bg.wasm b/codecs/oxipng/pkg/squoosh_oxipng_bg.wasm
index d8dc493d..97715f1a 100644
Binary files a/codecs/oxipng/pkg/squoosh_oxipng_bg.wasm and b/codecs/oxipng/pkg/squoosh_oxipng_bg.wasm differ