Fix orientation of thumbnails
All checks were successful
/ build (push) Successful in 1m14s
/ accessibility (push) Successful in 2m7s

(cherry picked from commit f6a698a64b)
This commit is contained in:
Stefan Bethke 2026-10-17 10:55:54 +02:00
commit 311a3b1370
3 changed files with 15 additions and 7 deletions

View file

@ -27,7 +27,9 @@ og:image:alt.
{{- with $resource -}}
{{- $image := . -}}
{{- if and (eq .ResourceType "image") (ne .MediaType.SubType "svg") -}}
{{- if gt .Width 1200 }}{{ $image = .Resize "1200x" }}{{ end -}}
{{- /* Turned as its EXIF orientation says; Hugo doesn't do that when it resizes. */ -}}
{{- $image = .Filter images.AutoOrient -}}
{{- if gt $image.Width 1200 }}{{ $image = $image.Resize "1200x" }}{{ end -}}
{{- $width = $image.Width -}}
{{- $height = $image.Height -}}
{{- end -}}