1

Préserver les GIF animés lors des transformations d'images

This commit is contained in:
2026-03-06 22:54:15 +01:00
parent d16c29fc5d
commit 3ec52dfc71
10 changed files with 90 additions and 14 deletions

View File

@@ -15,13 +15,21 @@
{{- if gt $image.Width $maxWidth -}}
{{- $targetWidth = $maxWidth -}}
{{- end -}}
{{- $display = $image.Resize (printf "%dx webp q80" $targetWidth) -}}
{{- $display = partial "media/process-image.html" (dict
"image" $image
"action" "Resize"
"spec" (printf "%dx" $targetWidth)
) -}}
{{- else -}}
{{- $targetHeight := $image.Height -}}
{{- if gt $image.Height 900 -}}
{{- $targetHeight = 900 -}}
{{- end -}}
{{- $display = $image.Resize (printf "x%d webp q80" $targetHeight) -}}
{{- $display = partial "media/process-image.html" (dict
"image" $image
"action" "Resize"
"spec" (printf "x%d" $targetHeight)
) -}}
{{- end -}}
{{- end -}}