Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

fix(backend): use EXIF metadata for thumbnail orientation

7185bf03bb8dfe6b
diff --git a/backend/src/common/image.ts b/backend/src/common/image.ts
index bc5d6bad..fb7aeb3c 100644
--- a/backend/src/common/image.ts
+++ b/backend/src/common/image.ts
@@ -13,7 +13,7 @@ export const pngMimeType = 'image/png'
export const svgMimeType = 'image/svg+xml'
export async function generateThumbnail(filePath: string, size: number) {
- const image = sharp(filePath)
+ const image = sharp(filePath).rotate()
let { width, height } = await image.metadata()
if (!width || !height) throw new Error('Invalid image dimensions')