fix: typo + calling cleanup methods in wasm codecs
This commit is contained in:
parent
59b5fec7be
commit
1145ee1e09
2 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue