diff --git a/server/front/src/index.ts b/server/front/src/index.ts index c1089e264d..9a49eb950e 100644 --- a/server/front/src/index.ts +++ b/server/front/src/index.ts @@ -926,6 +926,9 @@ async function getGeneratePreview ( } sharp.cache(false) + // auto orient image based on exif to prevent resize use wrong orientation + pipeline = pipeline.rotate() + pipeline = pipeline.resize({ width: size, fit: 'cover', diff --git a/services/datalake/pod-datalake/src/handlers/image.ts b/services/datalake/pod-datalake/src/handlers/image.ts index a40c17dc58..b62419f8e4 100644 --- a/services/datalake/pod-datalake/src/handlers/image.ts +++ b/services/datalake/pod-datalake/src/handlers/image.ts @@ -105,6 +105,10 @@ export async function handleImageGet ( await writeFile(tmpFile, blob.body) let pipeline = sharp(tmpFile) + + // auto orient image based on exif to prevent resize use wrong orientation + pipeline = pipeline.rotate() + pipeline.resize({ width, height,