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
+4 -4
View File
@@ -383,11 +383,11 @@ function formatDate (iso: string): string {
}
}
function formatBytes (bytes: number): string {
export function formatBytes (bytes: number): string {
if (bytes < 1024) return bytes + ' B'
const kb = bytes / 1024
if (kb < 1024) return kb.toFixed(1) + ' KB'
if (kb < 1024) return kb.toFixed(1) + ' KiB'
const mb = kb / 1024
if (mb < 1024) return mb.toFixed(1) + ' MB'
return (mb / 1024).toFixed(2) + ' GB'
if (mb < 1024) return mb.toFixed(1) + ' MiB'
return (mb / 1024).toFixed(2) + ' GiB'
}