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 -}}