From fcebb9efb61dec59f0a0a7c6b722c9ebf6bcaa84 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Wed, 15 Apr 2020 07:46:29 +0200 Subject: [PATCH] Fix image orientation issue --- src/entities/RequestHandler.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/entities/RequestHandler.ts b/src/entities/RequestHandler.ts index 4a2ae50..ecdf6c2 100644 --- a/src/entities/RequestHandler.ts +++ b/src/entities/RequestHandler.ts @@ -106,6 +106,11 @@ export class RequestHandler extends BaseRequestsHandler { else img = img.resize(Math.floor((stats.width*maxH)/stats.height), maxH); } + + // Rotate the image, if required + if(stats.orientation != undefined) { + img = img.rotate(/* use EXIF orientation header */) + } // Save image await img.png().toFile(targetSysPath);