diff --git a/app/src/gallery/builder.ts b/app/src/gallery/builder.ts index d3fa9b2..0c0169b 100644 --- a/app/src/gallery/builder.ts +++ b/app/src/gallery/builder.ts @@ -81,11 +81,15 @@ export async function gallery (res: Response, share: SharedLink, openItem?: numb ? asset.exifInfo.description : '' - let width = asset.exifInfo?.exifImageWidth - let height = asset.exifInfo?.exifImageHeight - const orientation = asset.exifInfo?.orientation - if (orientation && ['5', '6', '7', '8'].includes(orientation) && width && height) { - [width, height] = [height, width] + let width = asset.width + let height = asset.height + if (!width || !height) { + width = asset.exifInfo?.exifImageWidth + height = asset.exifInfo?.exifImageHeight + const orientation = asset.exifInfo?.orientation + if (orientation && ['5', '6', '7', '8'].includes(orientation) && width && height) { + [width, height] = [height, width] + } } return { diff --git a/app/src/types.ts b/app/src/types.ts index 04be372..dc96839 100644 --- a/app/src/types.ts +++ b/app/src/types.ts @@ -51,6 +51,8 @@ export interface Asset { type: AssetType; isTrashed: boolean; exifInfo?: ExifInfo; + width?: number; + height?: number; // Base64-encoded thumbhash for tasteful blur placeholders during lazy-load thumbhash?: string; }