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

View file

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