diff --git a/docker/frontend/src/Library.tsx b/docker/frontend/src/Library.tsx index 3bba480..32e3bba 100644 --- a/docker/frontend/src/Library.tsx +++ b/docker/frontend/src/Library.tsx @@ -562,13 +562,7 @@ export function Library() { keep(VIEW_KEY, view); }, [view]); - // Clear global memory caches when leaving Library screen - useEffect(() => { - return () => { - shots.clear(); - clearLibraryCache(); - }; - }, []); + // Keep global memory caches in RAM during SPA tab navigation between STUDIO and LIBRARY // The menu closes on the next click anywhere but its own items, and on Escape. // Escape is the whole reason this listens on the document instead of sitting diff --git a/docker/frontend/src/engine/library.ts b/docker/frontend/src/engine/library.ts index 72c88c3..a8ad76a 100644 --- a/docker/frontend/src/engine/library.ts +++ b/docker/frontend/src/engine/library.ts @@ -893,8 +893,8 @@ export async function scanFolder( } const raw = isRawName(file.name); const isTiff = /\.(tiff?)$/i.test(file.name); - const RAW_HEADER_BYTES = 4 * 1024 * 1024; - const sliceBuffer = await file.slice(0, (raw || isTiff) ? (isTiff ? Math.min(file.size, 16 * 1024 * 1024) : RAW_HEADER_BYTES) : HEAD_BYTES).arrayBuffer(); + const RAW_HEADER_BYTES = 16 * 1024 * 1024; + const sliceBuffer = await file.slice(0, (raw || isTiff) ? Math.min(file.size, RAW_HEADER_BYTES) : HEAD_BYTES).arrayBuffer(); const bytes = new Uint8Array(sliceBuffer); const preview = (raw || isTiff) ? await rawThumbnail(bytes, file.name) : null; const src = preview ? new Blob([preview as BlobPart], { type: 'image/jpeg' }) : raw ? null : file; diff --git a/docker/frontend/src/engine/rawDevelop.ts b/docker/frontend/src/engine/rawDevelop.ts index c5a91aa..490cc9e 100644 --- a/docker/frontend/src/engine/rawDevelop.ts +++ b/docker/frontend/src/engine/rawDevelop.ts @@ -664,8 +664,12 @@ export async function developRaw(bytes: Uint8Array): Promise { // The preview still opens the file when the sensor will not: a RAW whose // colour data is missing (some DNG) is not a RAW that cannot be shown. if (preview) return preview; + const fallback = await rawThumbnail(bytes).catch(() => null); + if (fallback) return fallback; throw err; } finally { - raw.dispose(); + try { + raw.dispose(); + } catch {} } } diff --git a/docker/recipescam-images.tar.gz b/docker/recipescam-images.tar.gz index d49d6db..8ceaf58 100644 Binary files a/docker/recipescam-images.tar.gz and b/docker/recipescam-images.tar.gz differ diff --git a/docker/recipescam-images.tar.gz.sha256 b/docker/recipescam-images.tar.gz.sha256 index 6e63d80..8f481aa 100644 --- a/docker/recipescam-images.tar.gz.sha256 +++ b/docker/recipescam-images.tar.gz.sha256 @@ -1 +1 @@ -0691741305a54025579249facae529bcb54ba48b007db5e098abacb2392a458b recipescam-images.tar.gz +cba5ee0a2b68571a02b91eeb93428b22dbbb4c8969937770f71aa87c031242d3 recipescam-images.tar.gz