mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: show real image dimensions in right pane for DNG/RAW files
The preview endpoint now returns X-Original-Width/Height headers with dimensions read from Sharp metadata (or ExifTool for RAW files). The frontend stores these in FileEntry and the ImageViewer prefers them over the browser's naturalWidth/naturalHeight, which reflects the resized preview rather than the original sensor dimensions.
This commit is contained in:
@@ -141,7 +141,7 @@ export const useCollageStore = create<CollageState>((set, get) => ({
|
||||
for (const img of newImages) {
|
||||
if (img.previewLoading) {
|
||||
const imgId = img.id;
|
||||
fetchDecodedPreview(img.file).then((url) => {
|
||||
fetchDecodedPreview(img.file).then((result) => {
|
||||
const current = get();
|
||||
const idx = current.images.findIndex((i) => i.id === imgId);
|
||||
if (idx === -1) return;
|
||||
@@ -149,7 +149,7 @@ export const useCollageStore = create<CollageState>((set, get) => ({
|
||||
updated[idx] = {
|
||||
...updated[idx],
|
||||
previewLoading: false,
|
||||
...(url ? { previewBlobUrl: url } : {}),
|
||||
...(result ? { previewBlobUrl: result.url } : {}),
|
||||
};
|
||||
set({ images: updated });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user