Make images smaller using best-in-class codecs, right in the browser.
JavaScript
Updating oxi build & enabling alpha optimisations (#776)
Jake Archibald17ffa57a8bd8
diff --git a/codecs/oxipng/Cargo.lock b/codecs/oxipng/Cargo.lockindex 4787588d..2ca07ed0 100644--- a/codecs/oxipng/Cargo.lock+++ b/codecs/oxipng/Cargo.lock@@ -1,502 +1,544 @@# This file is automatically @generated by Cargo.# It is not intended for manual editing.+[[package]]+name = "adler"+version = "0.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"+[[package]]name = "adler32"-version = "1.0.4"+version = "1.1.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "567b077b825e468cc974f0020d4082ee6e03132512f207ef1a02fd5d00d1f32d"[[package]]name = "autocfg"version = "1.0.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"[[package]]name = "bit-vec"-version = "0.6.1"+version = "0.6.2"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3"[[package]]name = "bitflags"version = "1.2.1"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"[[package]]name = "build_const"version = "0.2.1"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39"[[package]]name = "bumpalo"-version = "3.2.1"+version = "3.4.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820"[[package]]name = "bytemuck"version = "1.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "37fa13df2292ecb479ec23aa06f4507928bef07839be9ef15281411076629431"[[package]]name = "byteorder"version = "1.3.4"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"[[package]]name = "cc"-version = "1.0.50"+version = "1.0.58"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518"[[package]]name = "cfg-if"version = "0.1.10"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"[[package]]name = "cloudflare-zlib"version = "0.2.5"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f5ed63a019d55bacd15cadcbcb96bf41b16281417fff393bdb55fa84255fe4b9"dependencies = [- "cloudflare-zlib-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "cloudflare-zlib-sys",][[package]]name = "cloudflare-zlib-sys"version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7e195cb274a0d6ee87e718838a09baecd7cbc9f6075dac256a84cb5842739c06"dependencies = [- "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)",+ "cc",][[package]]name = "crc"version = "1.8.1"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"dependencies = [- "build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",+ "build_const",][[package]]name = "crc32fast"version = "1.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"dependencies = [- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",+ "cfg-if",][[package]]name = "crossbeam-deque"version = "0.7.3"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285"dependencies = [- "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",- "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",- "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "crossbeam-epoch",+ "crossbeam-utils",+ "maybe-uninit",][[package]]name = "crossbeam-epoch"version = "0.8.2"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"dependencies = [- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",- "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",- "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",- "memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",- "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "autocfg",+ "cfg-if",+ "crossbeam-utils",+ "lazy_static",+ "maybe-uninit",+ "memoffset",+ "scopeguard",][[package]]name = "crossbeam-queue"-version = "0.2.1"+version = "0.2.3"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570"dependencies = [- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",- "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",+ "cfg-if",+ "crossbeam-utils",+ "maybe-uninit",][[package]]name = "crossbeam-utils"version = "0.7.2"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"dependencies = [- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "autocfg",+ "cfg-if",+ "lazy_static",][[package]]name = "deflate"-version = "0.8.3"+version = "0.8.6"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174"dependencies = [- "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",- "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",+ "adler32",+ "byteorder",][[package]]name = "either"version = "1.5.3"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3"[[package]]name = "hermit-abi"-version = "0.1.10"+version = "0.1.15"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9"dependencies = [- "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",+ "libc",][[package]]name = "image"-version = "0.23.2"+version = "0.23.7"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a2397fc43bd5648b7117aabb3c5e62d0e62c194826ec77b0b4d0c41e62744635"dependencies = [- "bytemuck 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",- "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",- "num-iter 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",- "num-rational 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",- "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",- "png 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)",+ "bytemuck",+ "byteorder",+ "num-iter",+ "num-rational",+ "num-traits",+ "png",][[package]]name = "indexmap"-version = "1.3.2"-source = "registry+https://github.com/rust-lang/crates.io-index"-dependencies = [- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",- "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",-]--[[package]]-name = "inflate"-version = "0.4.5"+version = "1.4.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe"dependencies = [- "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",+ "autocfg",+ "rayon",][[package]]name = "itertools"version = "0.9.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"dependencies = [- "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)",+ "either",][[package]]name = "lazy_static"version = "1.4.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"[[package]]name = "libc"-version = "0.2.68"+version = "0.2.72"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a9f8082297d534141b30c8d39e9b1773713ab50fdbe4ff30f750d063b3bfd701"++[[package]]+name = "libdeflate-sys"+version = "0.5.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "21e39efa87b84db3e13ff4e2dfac1e57220abcbd7fe8ec44d238f7f4f787cc1f"+dependencies = [+ "cc",+][[package]]name = "libdeflater"-version = "0.2.0"+version = "0.5.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a4810980d791f26d470e2d7d91a3d4d22aa3a4b709fb7e9c5e43ee54f83a01f2"dependencies = [- "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)",+ "libdeflate-sys",][[package]]name = "log"version = "0.4.8"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"dependencies = [- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",+ "cfg-if",][[package]]name = "maybe-uninit"version = "2.0.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"[[package]]name = "memoffset"-version = "0.5.4"+version = "0.5.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f"+dependencies = [+ "autocfg",+]++[[package]]+name = "miniz_oxide"+version = "0.3.7"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435"dependencies = [- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "adler32",][[package]]name = "miniz_oxide"-version = "0.3.6"+version = "0.4.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f"dependencies = [- "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",+ "adler",][[package]]name = "num-integer"-version = "0.1.42"+version = "0.1.43"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b"dependencies = [- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",- "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",+ "autocfg",+ "num-traits",][[package]]name = "num-iter"-version = "0.1.40"+version = "0.1.41"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f"dependencies = [- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",- "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",- "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",+ "autocfg",+ "num-integer",+ "num-traits",][[package]]name = "num-rational"-version = "0.2.4"+version = "0.3.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a5b4d7360f362cfb50dde8143501e6940b22f644be75a4cc90b2d81968908138"dependencies = [- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",- "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",- "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",+ "autocfg",+ "num-integer",+ "num-traits",][[package]]name = "num-traits"-version = "0.2.11"+version = "0.2.12"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"dependencies = [- "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "autocfg",][[package]]name = "num_cpus"-version = "1.12.0"+version = "1.13.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"dependencies = [- "hermit-abi 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",- "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",-]--[[package]]-name = "oxipng"-version = "0.1.0"-dependencies = [- "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",- "oxipng 2.3.0 (git+https://github.com/shssoichiro/oxipng.git)",- "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)",+ "hermit-abi",+ "libc",][[package]]name = "oxipng"-version = "2.3.0"-source = "git+https://github.com/shssoichiro/oxipng.git#ec8ecf5a800dfb41359d9cf41eed8a730062b9a8"+version = "3.0.0"+source = "git+https://github.com/shssoichiro/oxipng.git#3b337ac9086d64ef8df7ad0c6b7ff9e4c178b3ef"dependencies = [- "bit-vec 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",- "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",- "cloudflare-zlib 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",- "crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)",- "image 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",- "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",- "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",- "libdeflater 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",- "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",- "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",- "rgb 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",- "zopfli 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "bit-vec",+ "byteorder",+ "cloudflare-zlib",+ "crc",+ "image",+ "indexmap",+ "itertools",+ "libdeflater",+ "log",+ "miniz_oxide 0.4.0",+ "rgb",+ "rustc_version",+ "zopfli",][[package]]name = "png"-version = "0.16.1"+version = "0.16.6"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c150bf7479fafe3dd8740dbe48cc33b2a3efb7b0fe3483aced8bbc39f6d0238d"dependencies = [- "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",- "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",- "deflate 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",- "inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",+ "bitflags",+ "crc32fast",+ "deflate",+ "miniz_oxide 0.3.7",][[package]]name = "proc-macro2"-version = "1.0.10"+version = "1.0.18"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa"dependencies = [- "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "unicode-xid",][[package]]name = "quote"-version = "1.0.3"+version = "1.0.7"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"dependencies = [- "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",+ "proc-macro2",][[package]]name = "rayon"-version = "1.3.0"+version = "1.3.1"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "62f02856753d04e03e26929f820d0a0a337ebe71f849801eea335d464b349080"dependencies = [- "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",- "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)",- "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "autocfg",+ "crossbeam-deque",+ "either",+ "rayon-core",][[package]]name = "rayon-core"-version = "1.7.0"+version = "1.7.1"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e92e15d89083484e11353891f1af602cc661426deb9564c298b270c726973280"dependencies = [- "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",- "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",- "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",- "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "crossbeam-deque",+ "crossbeam-queue",+ "crossbeam-utils",+ "lazy_static",+ "num_cpus",][[package]]name = "rgb"-version = "0.8.17"+version = "0.8.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "90ef54b45ae131327a88597e2463fee4098ad6c88ba7b6af4b3987db8aad4098"+dependencies = [+ "bytemuck",+]++[[package]]+name = "rustc_version"+version = "0.2.3"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"+dependencies = [+ "semver",+][[package]]name = "scopeguard"version = "1.1.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"++[[package]]+name = "semver"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"+dependencies = [+ "semver-parser",+]++[[package]]+name = "semver-parser"+version = "0.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"++[[package]]+name = "squoosh-oxipng"+version = "0.1.0"+dependencies = [+ "log",+ "oxipng",+ "wasm-bindgen",+][[package]]name = "syn"-version = "1.0.17"+version = "1.0.34"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "936cae2873c940d92e697597c5eee105fb570cd5689c695806f672883653349b"dependencies = [- "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",- "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",+ "proc-macro2",+ "quote",+ "unicode-xid",][[package]]name = "typed-arena"version = "1.7.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d"[[package]]name = "unicode-xid"-version = "0.2.0"+version = "0.2.1"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"[[package]]name = "wasm-bindgen"-version = "0.2.60"+version = "0.2.64"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6a634620115e4a229108b71bde263bb4220c483b3f07f5ba514ee8d15064c4c2"dependencies = [- "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",- "wasm-bindgen-macro 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)",+ "cfg-if",+ "wasm-bindgen-macro",][[package]]name = "wasm-bindgen-backend"-version = "0.2.60"+version = "0.2.64"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3e53963b583d18a5aa3aaae4b4c1cb535218246131ba22a71f05b518098571df"dependencies = [- "bumpalo 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)",- "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",- "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",- "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",- "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",- "wasm-bindgen-shared 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)",+ "bumpalo",+ "lazy_static",+ "log",+ "proc-macro2",+ "quote",+ "syn",+ "wasm-bindgen-shared",][[package]]name = "wasm-bindgen-macro"-version = "0.2.60"+version = "0.2.64"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3fcfd5ef6eec85623b4c6e844293d4516470d8f19cd72d0d12246017eb9060b8"dependencies = [- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",- "wasm-bindgen-macro-support 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)",+ "quote",+ "wasm-bindgen-macro-support",][[package]]name = "wasm-bindgen-macro-support"-version = "0.2.60"+version = "0.2.64"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9adff9ee0e94b926ca81b57f57f86d5545cdcb1d259e21ec9bdd95b901754c75"dependencies = [- "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",- "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",- "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",- "wasm-bindgen-backend 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)",- "wasm-bindgen-shared 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)",+ "proc-macro2",+ "quote",+ "syn",+ "wasm-bindgen-backend",+ "wasm-bindgen-shared",][[package]]name = "wasm-bindgen-shared"-version = "0.2.60"+version = "0.2.64"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7f7b90ea6c632dd06fd765d44542e234d5e63d9bb917ecd64d79778a13bd79ae"[[package]]name = "zopfli"version = "0.4.0"source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4079b79464426ade2a1b0177fb0ce8396ba6b4084267407e333573c666073964"dependencies = [- "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",- "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",- "crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)",- "typed-arena 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",-]--[metadata]-"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2"-"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"-"checksum bit-vec 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a4523a10839ffae575fb08aa3423026c8cb4687eef43952afb956229d4f246f7"-"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"-"checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39"-"checksum bumpalo 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "12ae9db68ad7fac5fe51304d20f016c911539251075a214f8e663babefa35187"-"checksum bytemuck 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37fa13df2292ecb479ec23aa06f4507928bef07839be9ef15281411076629431"-"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"-"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"-"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"-"checksum cloudflare-zlib 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f5ed63a019d55bacd15cadcbcb96bf41b16281417fff393bdb55fa84255fe4b9"-"checksum cloudflare-zlib-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7e195cb274a0d6ee87e718838a09baecd7cbc9f6075dac256a84cb5842739c06"-"checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"-"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"-"checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285"-"checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"-"checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db"-"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"-"checksum deflate 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "050ef6de42a33903b30a7497b76b40d3d58691d4d3eec355348c122444a388f0"-"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3"-"checksum hermit-abi 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "725cf19794cf90aa94e65050cb4191ff5d8fa87a498383774c47b332e3af952e"-"checksum image 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9062b90712d25bc6bb165d110aa59c6b47c849246e341e7b86a98daff9d49f60"-"checksum indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292"-"checksum inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff"-"checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"-"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"-"checksum libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0"-"checksum libdeflater 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "66dca08b13369865b2f6dca1dd05f833985cbe6c12a676b04d55f78b85e80246"-"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"-"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"-"checksum memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8"-"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5"-"checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba"-"checksum num-iter 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "dfb0800a0291891dd9f4fe7bd9c19384f98f7fbe0cd0f39a2c6b88b9868bbc00"-"checksum num-rational 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef"-"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"-"checksum num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6"-"checksum oxipng 2.3.0 (git+https://github.com/shssoichiro/oxipng.git)" = "<none>"-"checksum png 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "46060468187c21c00ffa2a920690b29997d7fd543f5a4d400461e4a7d4fccde8"-"checksum proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3"-"checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f"-"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098"-"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9"-"checksum rgb 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "a85b83fd629b0ce765f45316774fa6aaa95947fd74c8e4bbf3c6d1e349701d95"-"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"-"checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03"-"checksum typed-arena 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d"-"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"-"checksum wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "2cc57ce05287f8376e998cbddfb4c8cb43b84a7ec55cf4551d7c00eef317a47f"-"checksum wasm-bindgen-backend 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d967d37bf6c16cca2973ca3af071d0a2523392e4a594548155d89a678f4237cd"-"checksum wasm-bindgen-macro 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "8bd151b63e1ea881bb742cd20e1d6127cef28399558f3b5d415289bc41eee3a4"-"checksum wasm-bindgen-macro-support 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d68a5b36eef1be7868f668632863292e37739656a80fc4b9acec7b0bd35a4931"-"checksum wasm-bindgen-shared 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "daf76fe7d25ac79748a37538b7daeed1c7a6867c92d3245c12c6222e4a20d639"-"checksum zopfli 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4079b79464426ade2a1b0177fb0ce8396ba6b4084267407e333573c666073964"+ "adler32",+ "byteorder",+ "crc",+ "typed-arena",+]diff --git a/codecs/oxipng/Cargo.toml b/codecs/oxipng/Cargo.tomlindex db0dc217..5701af5d 100644--- a/codecs/oxipng/Cargo.toml+++ b/codecs/oxipng/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "oxipng"+name = "squoosh-oxipng"version = "0.1.0"authors = ["Ingvar Stepanyan <[email protected]>"]edition = "2018"@@ -9,8 +9,8 @@ publish = falsecrate-type = ["cdylib"][dependencies]-oxipng = { version = "2.3.0", default-features = false }-wasm-bindgen = "0.2.48"+oxipng = { version = "3.0.0", default-features = false }+wasm-bindgen = "0.2.64"log = { version = "0.4", features = ["release_max_level_off"] }[profile.release]diff --git a/codecs/oxipng/Dockerfile b/codecs/oxipng/Dockerfileindex 41029b7b..5448d170 100644--- a/codecs/oxipng/Dockerfile+++ b/codecs/oxipng/Dockerfile@@ -3,10 +3,10 @@ RUN rustup target add wasm32-unknown-unknownRUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | shRUN mkdir /opt/wabt && \- curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.11/wabt-1.0.11-linux.tar.gz | tar -xzf - -C /opt/wabt --strip 1+ curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.17/wabt-1.0.17-ubuntu.tar.gz | tar -xzf - -C /opt/wabt --strip 1RUN mkdir /opt/wasi-sdk && \- curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-8/wasi-sdk-8.0-linux.tar.gz | tar -xzf - -C /opt/wasi-sdk --strip 1+ curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-11/wasi-sdk-11.0-linux.tar.gz | tar -xzf - -C /opt/wasi-sdk --strip 1-ENV PATH="/opt/wabt:/opt/wasi-sdk/bin:${PATH}"+ENV PATH="/opt/wabt/bin:/opt/wasi-sdk/bin:${PATH}"WORKDIR /srcdiff --git a/codecs/oxipng/build.sh b/codecs/oxipng/build.shold mode 100644new mode 100755index 1e46f657..3b607ee7--- a/codecs/oxipng/build.sh+++ b/codecs/oxipng/build.sh@@ -7,7 +7,7 @@ echo "Compiling wasm"echo "============================================="(wasm-pack build- wasm-strip pkg/oxipng_bg.wasm+ wasm-strip pkg/squoosh_oxipng_bg.wasmrm pkg/.gitignore)echo "============================================="diff --git a/codecs/oxipng/pkg/oxipng_bg.wasm b/codecs/oxipng/pkg/oxipng_bg.wasmdeleted file mode 100644index d6d45940..00000000Binary files a/codecs/oxipng/pkg/oxipng_bg.wasm and /dev/null differdiff --git a/codecs/oxipng/pkg/package.json b/codecs/oxipng/pkg/package.jsonindex 5dd8df18..80ba0476 100644--- a/codecs/oxipng/pkg/package.json+++ b/codecs/oxipng/pkg/package.json@@ -1,15 +1,15 @@{- "name": "oxipng",+ "name": "squoosh-oxipng","collaborators": ["Ingvar Stepanyan <[email protected]>"],"version": "0.1.0","files": [- "oxipng_bg.wasm",- "oxipng.js",- "oxipng.d.ts"+ "squoosh_oxipng_bg.wasm",+ "squoosh_oxipng.js",+ "squoosh_oxipng.d.ts"],- "module": "oxipng.js",- "types": "oxipng.d.ts",+ "module": "squoosh_oxipng.js",+ "types": "squoosh_oxipng.d.ts","sideEffects": false}\ No newline at end of filediff --git a/codecs/oxipng/pkg/oxipng.d.ts b/codecs/oxipng/pkg/squoosh_oxipng.d.tssimilarity index 60%rename from codecs/oxipng/pkg/oxipng.d.tsrename to codecs/oxipng/pkg/squoosh_oxipng.d.tsindex 104d8f4a..1c95bae4 100644--- a/codecs/oxipng/pkg/oxipng.d.ts+++ b/codecs/oxipng/pkg/squoosh_oxipng.d.ts@@ -1,8 +1,8 @@/* tslint:disable *//* eslint-disable *//**-* @param {Uint8Array} data-* @param {number} level-* @returns {Uint8Array}+* @param {Uint8Array} data+* @param {number} level+* @returns {Uint8Array}*/export function optimise(data: Uint8Array, level: number): Uint8Array;diff --git a/codecs/oxipng/pkg/squoosh_oxipng.js b/codecs/oxipng/pkg/squoosh_oxipng.jsnew file mode 100644index 00000000..24abe864--- /dev/null+++ b/codecs/oxipng/pkg/squoosh_oxipng.js@@ -0,0 +1,2 @@+import * as wasm from "./squoosh_oxipng_bg.wasm";+export * from "./squoosh_oxipng_bg.js";\ No newline at end of filediff --git a/codecs/oxipng/pkg/oxipng_bg.d.ts b/codecs/oxipng/pkg/squoosh_oxipng_bg.d.tssimilarity index 100%rename from codecs/oxipng/pkg/oxipng_bg.d.tsrename to codecs/oxipng/pkg/squoosh_oxipng_bg.d.tsdiff --git a/codecs/oxipng/pkg/oxipng.js b/codecs/oxipng/pkg/squoosh_oxipng_bg.jssimilarity index 90%rename from codecs/oxipng/pkg/oxipng.jsrename to codecs/oxipng/pkg/squoosh_oxipng_bg.jsindex cce9b303..87154f54 100644--- a/codecs/oxipng/pkg/oxipng.js+++ b/codecs/oxipng/pkg/squoosh_oxipng_bg.js@@ -1,6 +1,6 @@-import * as wasm from './oxipng_bg.wasm';+import * as wasm from './squoosh_oxipng_bg.wasm';-const lTextDecoder = typeof TextDecoder === 'undefined' ? require('util').TextDecoder : TextDecoder;+const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });diff --git a/codecs/oxipng/pkg/squoosh_oxipng_bg.wasm b/codecs/oxipng/pkg/squoosh_oxipng_bg.wasmnew file mode 100644index 00000000..408eb08eBinary files /dev/null and b/codecs/oxipng/pkg/squoosh_oxipng_bg.wasm differdiff --git a/codecs/oxipng/src/lib.rs b/codecs/oxipng/src/lib.rsindex 60b64439..c4ead1d2 100644--- a/codecs/oxipng/src/lib.rs+++ b/codecs/oxipng/src/lib.rs@@ -1,10 +1,18 @@mod malloc_shim;use wasm_bindgen::prelude::*;+use oxipng::AlphaOptim;#[wasm_bindgen(catch)]pub fn optimise(data: &[u8], level: u8) -> Vec<u8> {let mut options = oxipng::Options::from_preset(level);+ options.alphas.insert(AlphaOptim::Black);+ options.alphas.insert(AlphaOptim::White);+ options.alphas.insert(AlphaOptim::Up);+ options.alphas.insert(AlphaOptim::Down);+ options.alphas.insert(AlphaOptim::Left);+ options.alphas.insert(AlphaOptim::Right);+options.deflate = oxipng::Deflaters::Libdeflater;oxipng::optimize_from_memory(data, &options).unwrap_throw()}