feat: add QOI codec, format encoders (BMP/ICO/JP2/QOI), fix JXL output bug

This commit is contained in:
SnapOtter
2026-05-08 00:09:55 +08:00
parent 5c9fa2de49
commit 390b5adb8c
7 changed files with 329 additions and 7 deletions
@@ -10,10 +10,11 @@ const FORMAT_MAP: Record<string, string> = {
heif: "avif",
tiff: "tiff",
gif: "gif",
jxl: "jxl",
};
/** Formats that Sharp cannot encode — fall back to PNG for output. */
const NO_ENCODER = new Set(["svg", "bmp", "raw", "tga", "psd", "exr", "hdr", "ico"]);
const NO_ENCODER = new Set(["svg", "raw", "tga", "psd", "exr", "hdr"]);
function formatOpts(format: string, quality: number): Record<string, unknown> {
const opts: Record<string, unknown> = { quality };