Add PNG encoding support

This commit is contained in:
Surma
2020-09-18 16:00:29 +01:00
parent 516c0aa8e7
commit 139b635eed
3 changed files with 4 additions and 2 deletions

View File

@@ -133,7 +133,10 @@ export default {
}, },
enc: async () => { enc: async () => {
await pngEncDecPromise; await pngEncDecPromise;
return { encode: (...args) => new Uint8Array(pngEncode(...args)) }; return {
encode: (buffer, ...args) =>
new Uint8Array(pngEncode(new Uint8Array(buffer), ...args))
};
}, },
defaultEncoderOptions: {} defaultEncoderOptions: {}
} }

1
codecs/png/Cargo.lock generated
View File

@@ -116,7 +116,6 @@ dependencies = [
name = "squoosh-png" name = "squoosh-png"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"log",
"png", "png",
"wasm-bindgen", "wasm-bindgen",
"web-sys", "web-sys",

Binary file not shown.