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:
@@ -19,6 +19,8 @@ interface ImageViewerProps {
|
||||
src: string;
|
||||
filename: string;
|
||||
fileSize: number;
|
||||
originalWidth?: number | null;
|
||||
originalHeight?: number | null;
|
||||
cssRotate?: number;
|
||||
cssFlipH?: boolean;
|
||||
cssFlipV?: boolean;
|
||||
@@ -34,6 +36,8 @@ export function ImageViewer({
|
||||
src,
|
||||
filename,
|
||||
fileSize,
|
||||
originalWidth,
|
||||
originalHeight,
|
||||
cssRotate,
|
||||
cssFlipH,
|
||||
cssFlipV,
|
||||
@@ -298,9 +302,9 @@ export function ImageViewer({
|
||||
<div className="flex items-center justify-between px-3 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0">
|
||||
<span className="truncate mr-2">{filename}</span>
|
||||
<div className="flex items-center gap-3 shrink-0">
|
||||
{naturalWidth != null && naturalHeight != null && (
|
||||
{(originalWidth || naturalWidth) != null && (originalHeight || naturalHeight) != null && (
|
||||
<span>
|
||||
{naturalWidth} x {naturalHeight}
|
||||
{originalWidth || naturalWidth} x {originalHeight || naturalHeight}
|
||||
</span>
|
||||
)}
|
||||
<span>{formatFileSize(fileSize)}</span>
|
||||
|
||||
Reference in New Issue
Block a user