mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 15:27:49 +01:00
fix photo upload with exif-rotated photos
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user