forked from external-repos/squoosh
Swap OptiPNG with OxiPNG
This makes building simpler and allows us to potentially use multithreading version in the future. For now points to a custom fork of OxiPNG that enables WebAssembly support, as PR is still pending review.
This commit is contained in:
committed by
Ingvar Stepanyan
parent
4621cbcae9
commit
629d64326d
@@ -57,13 +57,13 @@ async function resize(
|
||||
return timed('resize', () => resize(data, opts));
|
||||
}
|
||||
|
||||
async function optiPngEncode(
|
||||
data: BufferSource, options: import('../optipng/encoder-meta').EncodeOptions,
|
||||
async function oxiPngEncode(
|
||||
data: ArrayBuffer, options: import('../oxipng/encoder-meta').EncodeOptions,
|
||||
): Promise<ArrayBuffer> {
|
||||
const { compress } = await import(
|
||||
/* webpackChunkName: "process-optipng" */
|
||||
'../optipng/encoder');
|
||||
return timed('optiPngEncode', () => compress(data, options));
|
||||
/* webpackChunkName: "process-oxipng" */
|
||||
'../oxipng/encoder');
|
||||
return timed('oxiPngEncode', () => compress(data, options));
|
||||
}
|
||||
|
||||
async function webpEncode(
|
||||
@@ -87,7 +87,7 @@ const exports = {
|
||||
quantize,
|
||||
rotate,
|
||||
resize,
|
||||
optiPngEncode,
|
||||
oxiPngEncode,
|
||||
webpEncode,
|
||||
webpDecode,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user