fix: typo + calling cleanup methods in wasm codecs

This commit is contained in:
Tony Sullivan 2022-09-15 12:32:33 -05:00
parent 59b5fec7be
commit 1145ee1e09
2 changed files with 4 additions and 1 deletions

View file

@ -162,6 +162,7 @@ export const preprocessors = {
width,
height
)
resize.cleanup()
return imageData
}
},
@ -334,6 +335,7 @@ export const codecs = {
return {
decode: (buffer: Buffer | Uint8Array) => {
const imageData = pngEncDec.decode(buffer)
pngEncDec.cleanup()
return imageData
},
}
@ -354,6 +356,7 @@ export const codecs = {
height
)
const imageData = oxipng.optimise(simplePng, opts.level, false)
oxipng.cleanup()
return imageData
},
}

View file

@ -136,7 +136,7 @@ export async function processBuffer(
}) as Uint8Array;
case 'webp':
return await worker.dispatchJob({
operation: 'encodejpeg',
operation: 'encodewebp',
imageData,
quality: quality || 100,
}) as Uint8Array;