Fix #246 Metadata is not hidden when "Show metadata" is disabled
This commit is contained in:
@@ -81,11 +81,15 @@ export async function gallery (res: Response, share: SharedLink, openItem?: numb
|
|||||||
? asset.exifInfo.description
|
? asset.exifInfo.description
|
||||||
: ''
|
: ''
|
||||||
|
|
||||||
let width = asset.exifInfo?.exifImageWidth
|
let width = asset.width
|
||||||
let height = asset.exifInfo?.exifImageHeight
|
let height = asset.height
|
||||||
const orientation = asset.exifInfo?.orientation
|
if (!width || !height) {
|
||||||
if (orientation && ['5', '6', '7', '8'].includes(orientation) && width && height) {
|
width = asset.exifInfo?.exifImageWidth
|
||||||
[width, height] = [height, width]
|
height = asset.exifInfo?.exifImageHeight
|
||||||
|
const orientation = asset.exifInfo?.orientation
|
||||||
|
if (orientation && ['5', '6', '7', '8'].includes(orientation) && width && height) {
|
||||||
|
[width, height] = [height, width]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ export interface Asset {
|
|||||||
type: AssetType;
|
type: AssetType;
|
||||||
isTrashed: boolean;
|
isTrashed: boolean;
|
||||||
exifInfo?: ExifInfo;
|
exifInfo?: ExifInfo;
|
||||||
|
width?: number;
|
||||||
|
height?: number;
|
||||||
// Base64-encoded thumbhash for tasteful blur placeholders during lazy-load
|
// Base64-encoded thumbhash for tasteful blur placeholders during lazy-load
|
||||||
thumbhash?: string;
|
thumbhash?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user