mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: clear error when navigating to cached image info and pass RAW extension
Error from a failed image (e.g. DNG) persisted when navigating to a previously cached image because the cache path skipped setError(null). Also pass the original file extension to decodeToSharpCompat so RAW variants get the correct temp file suffix for ExifTool/ImageMagick.
This commit is contained in:
@@ -44,8 +44,9 @@ export function registerInfo(app: FastifyInstance) {
|
|||||||
|
|
||||||
// Decode CLI formats and HEIC before reading metadata
|
// Decode CLI formats and HEIC before reading metadata
|
||||||
let metaBuffer = fileBuffer;
|
let metaBuffer = fileBuffer;
|
||||||
|
const ext = filename.split(".").pop()?.toLowerCase();
|
||||||
if (detectedFormat && needsCliDecode(detectedFormat)) {
|
if (detectedFormat && needsCliDecode(detectedFormat)) {
|
||||||
metaBuffer = await decodeToSharpCompat(fileBuffer, detectedFormat);
|
metaBuffer = await decodeToSharpCompat(fileBuffer, detectedFormat, ext);
|
||||||
} else {
|
} else {
|
||||||
metaBuffer = await ensureSharpCompat(fileBuffer);
|
metaBuffer = await ensureSharpCompat(fileBuffer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export function InfoSettings() {
|
|||||||
|
|
||||||
const cached = cacheRef.current.get(index);
|
const cached = cacheRef.current.get(index);
|
||||||
if (cached) {
|
if (cached) {
|
||||||
|
setError(null);
|
||||||
setInfo(cached);
|
setInfo(cached);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user