mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user