Import TIFF through the server and survive a wedged raw decoder
Browsers have no TIFF decoder, so TIFF import failed at createImageBitmap and the develop canvas asked for the undecodable original. TIFF now takes the raw proxy path (original stored, sharp writes the JPEG proxy) and the editor reads that proxy. LibRaw demosaic and preview calls are bounded so one bad file falls back to the embedded preview instead of hanging.
This commit is contained in:
+5
-1
@@ -7,7 +7,11 @@ const cache = new Map<string, ImageBitmap>();
|
||||
|
||||
/** Where to fetch the original (or raw proxy) when it is not cached on this device. */
|
||||
export function remoteAssetUrl(photo: PhotoRecord): string {
|
||||
if (photo.raw) return photo.previewUrl || `/api/photos/${encodeURIComponent(photo.id)}/preview`;
|
||||
// Server-decoded formats (TIFF today) keep a browser-readable JPEG proxy just
|
||||
// like raws; their original cannot be decoded by createImageBitmap.
|
||||
if (photo.raw || photo.decode === 'sharp') {
|
||||
return photo.previewUrl || `/api/photos/${encodeURIComponent(photo.id)}/preview`;
|
||||
}
|
||||
return `/api/photos/${encodeURIComponent(photo.id)}/original`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user