From d313bdcc323f5fa76df824febbea93e5ea86b23b Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Tue, 16 Sep 2025 19:15:59 +0100 Subject: [PATCH] Fix EXIF rotation Signed-off-by: Nikolaos Karaolidis --- layouts/partials/components/image/process.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/layouts/partials/components/image/process.html b/layouts/partials/components/image/process.html index 298f572..ea37eed 100644 --- a/layouts/partials/components/image/process.html +++ b/layouts/partials/components/image/process.html @@ -11,13 +11,17 @@ {{- $original = ($page.Resources.Get $src) | default (resources.Get $src) -}} {{- end -}} -{{- $full := $original | images.Filter (images.Process "webp q90") -}} +{{- $rotate := images.AutoOrient -}} -{{- $thumb := "" -}} +{{- $processFull := images.Process "webp q90" -}} +{{- $full := $original | images.Filter (slice $rotate $processFull) -}} + +{{- $processThumb := "" -}} {{- if gt $original.Width 2000 -}} - {{- $thumb = $original | images.Filter (images.Process "resize 2000x webp q75") -}} + {{- $processThumb = images.Process "resize 2000x webp q75" -}} {{- else -}} - {{- $thumb = $original | images.Filter (images.Process "webp q75") -}} + {{- $processThumb = images.Process "webp q75" -}} {{- end -}} +{{- $thumb := $original | images.Filter (slice $rotate $processThumb) -}} {{- return dict "original" $original "full" $full "thumb" $thumb -}}