fix: generate server-side previews for all non-browser formats

SERVER_PREVIEW_EXTENSIONS was missing TIFF, DDS, DPX, EPS, FITS, JP2,
PBM/PGM/PPM, QOI, SVGZ, CUR, and many RAW variants. The server
already had decoders for all of them but the client never triggered
the preview fetch, so users saw "Preview not available" instead.
This commit is contained in:
SnapOtter
2026-05-11 17:25:26 +08:00
parent 1d7a7188bf
commit a52a3b7e87
+50 -8
View File
@@ -3,19 +3,61 @@ import { formatHeaders } from "@/lib/api";
const SERVER_PREVIEW_EXTENSIONS = new Set([
"heic",
"heif",
"hif", // HEIF
"jxl", // JPEG XL (Chrome dropped support)
"ico", // ICO (Sharp can't decode)
"hif",
"jxl",
"ico",
"tiff",
"tif",
"dng",
"cr2",
"cr3",
"nef",
"nrw",
"arw",
"orf",
"rw2", // Camera RAW
"tga", // Targa
"psd", // Photoshop
"exr", // OpenEXR
"hdr", // Radiance HDR
"rw2",
"raf",
"pef",
"3fr",
"iiq",
"srw",
"x3f",
"rwl",
"gpr",
"fff",
"mrw",
"mef",
"kdc",
"dcr",
"erf",
"ptx",
"tga",
"psd",
"exr",
"hdr",
"dds",
"dpx",
"cin",
"eps",
"epsf",
"fits",
"fit",
"fts",
"jp2",
"j2k",
"j2c",
"jpc",
"jpf",
"jpx",
"pbm",
"pgm",
"ppm",
"pnm",
"pam",
"pfm",
"qoi",
"svgz",
"cur",
]);
export function needsServerPreview(file: File): boolean {