Fix orientation of thumbnails
All checks were successful
/ build (pull_request) Successful in 1m38s
/ accessibility (pull_request) Successful in 2m49s

This commit is contained in:
Stefan Bethke 2026-10-17 10:55:54 +02:00
commit f6a698a64b
3 changed files with 15 additions and 7 deletions

View file

@ -9,8 +9,11 @@ An image on its own line becomes a figure; images sharing a paragraph get an inl
{{- with or (.PageInner.Resources.Get (strings.TrimPrefix "./" .Destination)) (resources.Get .Destination) -}}
{{- $src = .RelPermalink -}}
{{- if and (eq .ResourceType "image") (ne .MediaType.SubType "svg") -}}
{{- $width = .Width -}}
{{- $height = .Height -}}
{{- /* Width and height as the browser shows the image, i.e. turned as its EXIF orientation
says (only JPEG and TIFF carry one). */ -}}
{{- $shown := cond (in (slice "jpeg" "tiff") .MediaType.SubType) (.Filter images.AutoOrient) . -}}
{{- $width = $shown.Width -}}
{{- $height = $shown.Height -}}
{{- end -}}
{{- end -}}
{{- /* A title that only repeats the alt text is not a credit. */ -}}