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 () => {
await pngEncDecPromise;
return { encode: (...args) => new Uint8Array(pngEncode(...args)) };
return {
encode: (buffer, ...args) =>
new Uint8Array(pngEncode(new Uint8Array(buffer), ...args))
};
},
defaultEncoderOptions: {}
}

1
codecs/png/Cargo.lock generated
View File

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

Binary file not shown.