diff --git a/src/util.ts b/src/util.ts index 0cace32..917f6df 100644 --- a/src/util.ts +++ b/src/util.ts @@ -18,7 +18,10 @@ export async function getSize(file: string): Promise { `The ${file} doesn't have width and height... how did we get there?`, ); } - return `${metadata.width}x${metadata.height}`; + const orientation = metadata.orientation ? metadata.orientation : 1; + return orientation <= 4 + ? `${metadata.width}x${metadata.height}` + : `${metadata.height}x${metadata.width}`; } export async function getShotDate(file: string): Promise {