mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-17 03:00:13 +00:00
Integrate encoder
This commit is contained in:
@@ -77,6 +77,15 @@ async function webpDecode(data: ArrayBuffer): Promise<ImageData> {
|
||||
return decode(data);
|
||||
}
|
||||
|
||||
async function jxlEncode(
|
||||
data: ImageData, options: import('../jxl/encoder-meta').EncodeOptions,
|
||||
): Promise<ArrayBuffer> {
|
||||
const { encode } = await import(
|
||||
/* webpackChunkName: "process-jxl-enc" */
|
||||
'../jxl/encoder');
|
||||
return encode(data, options);
|
||||
}
|
||||
|
||||
async function jxlDecode(data: ArrayBuffer): Promise<ImageData> {
|
||||
const { decode } = await import(
|
||||
/* webpackChunkName: "process-jxl-dec" */
|
||||
@@ -92,6 +101,7 @@ const exports = {
|
||||
optiPngEncode,
|
||||
webpEncode,
|
||||
webpDecode,
|
||||
jxlEncode,
|
||||
jxlDecode,
|
||||
};
|
||||
export type ProcessorWorkerApi = typeof exports;
|
||||
|
||||
Reference in New Issue
Block a user