Fix exif info display resolution orientation

This commit is contained in:
klymp
2026-07-26 17:20:54 +02:00
parent aa6183a95d
commit 626f6a1a3a
4 changed files with 31 additions and 4 deletions
+13
View File
@@ -55,6 +55,19 @@ describe('buildAssetMetadata', () => {
expect(meta.exif?.city).toBeUndefined()
})
it('reports dimensions in display orientation', () => {
setConfig({ ipp: { showMetadata: { exif: { dimensions: true } } } })
const photo = asset()
photo.exifInfo!.exifImageWidth = 4000
photo.exifInfo!.exifImageHeight = 3000
photo.exifInfo!.orientation = '6'
expect(buildAssetMetadata(photo, share()).exif).toMatchObject({
width: 3000,
height: 4000
})
})
it('returns description when a description surface is enabled', () => {
setConfig({ ipp: { showMetadata: { description: { sidebar: true } } } })
const meta = buildAssetMetadata(asset(), share())
+11
View File
@@ -0,0 +1,11 @@
import { describe, expect, it } from 'vitest'
import { formatBytes } from '../src/client/sidebar'
describe('sidebar file metadata formatting', () => {
it('uses binary unit labels for binary calculations', () => {
expect(formatBytes(1023)).toBe('1023 B')
expect(formatBytes(1024)).toBe('1.0 KiB')
expect(formatBytes(3_500_000)).toBe('3.3 MiB')
expect(formatBytes(3 * 1024 ** 3)).toBe('3.00 GiB')
})
})