Fix exif info display resolution orientation
This commit is contained in:
@@ -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'
|
||||
}
|
||||
|
||||
@@ -62,6 +62,9 @@ const EXIF_RULES: FieldRule[] = [
|
||||
if (info.exifImageWidth && info.exifImageHeight) {
|
||||
out.width = info.exifImageWidth
|
||||
out.height = info.exifImageHeight
|
||||
if (info.orientation && ['5', '6', '7', '8'].includes(info.orientation)) {
|
||||
[out.width, out.height] = [out.height, out.width]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user