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,
|
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
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue