fix photo upload with exif-rotated photos

This commit is contained in:
2022-10-12 23:18:34 +02:00
parent 7de6bad9fd
commit e7f0b7951d

View File

@@ -18,7 +18,10 @@ export async function getSize(file: string): Promise<string> {
`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<Date | null> {