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
|
||||
let metaBuffer = fileBuffer;
|
||||
const ext = filename.split(".").pop()?.toLowerCase();
|
||||
if (detectedFormat && needsCliDecode(detectedFormat)) {
|
||||
metaBuffer = await decodeToSharpCompat(fileBuffer, detectedFormat);
|
||||
metaBuffer = await decodeToSharpCompat(fileBuffer, detectedFormat, ext);
|
||||
} else {
|
||||
metaBuffer = await ensureSharpCompat(fileBuffer);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ export function InfoSettings() {
|
||||
|
||||
const cached = cacheRef.current.get(index);
|
||||
if (cached) {
|
||||
setError(null);
|
||||
setInfo(cached);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user