From 347a3630f1f7dba26539cecc9c8d39cc12c029c3 Mon Sep 17 00:00:00 2001 From: Edgaras Ausvicas Date: Wed, 8 May 2024 17:38:59 +0200 Subject: [PATCH] Use AutoOrient filter when resizing images --- layouts/partials/article-link/card-related.html | 6 +++++- layouts/partials/article-link/card.html | 6 +++++- layouts/partials/article-link/simple.html | 6 +++++- layouts/partials/hero/background.html | 6 +++++- layouts/partials/hero/basic.html | 6 +++++- layouts/partials/hero/big.html | 6 +++++- layouts/partials/hero/thumbAndBackground.html | 12 ++++++++++-- layouts/partials/term-link/card.html | 6 +++++- 8 files changed, 45 insertions(+), 9 deletions(-) diff --git a/layouts/partials/article-link/card-related.html b/layouts/partials/article-link/card-related.html index c7dbcc35..538c56b9 100644 --- a/layouts/partials/article-link/card-related.html +++ b/layouts/partials/article-link/card-related.html @@ -24,7 +24,11 @@ {{ end }} {{ else }} - {{ with .Resize "600x" }} + {{ $filters := slice + images.AutoOrient + (images.Process "resize 600x") + }} + {{ with images.Filter $filters . }} {{ end }} {{ end }} diff --git a/layouts/partials/article-link/card.html b/layouts/partials/article-link/card.html index dd2a7884..91ea9302 100644 --- a/layouts/partials/article-link/card.html +++ b/layouts/partials/article-link/card.html @@ -25,7 +25,11 @@
{{ end }} {{ else }} - {{ with .Resize "600x" }} + {{ $filters := slice + images.AutoOrient + (images.Process "resize 600x") + }} + {{ with images.Filter $filters . }}
{{ end }} {{ end }} diff --git a/layouts/partials/article-link/simple.html b/layouts/partials/article-link/simple.html index afee4875..3c5a396c 100644 --- a/layouts/partials/article-link/simple.html +++ b/layouts/partials/article-link/simple.html @@ -52,7 +52,11 @@
{{ end }} {{ else }} - {{ with .Resize "600x" }} + {{ $filters := slice + images.AutoOrient + (images.Process "resize 600x") + }} + {{ with images.Filter $filters . }}
{{ end }} {{ end }} diff --git a/layouts/partials/hero/background.html b/layouts/partials/hero/background.html index 1f6e3fb3..e0428235 100644 --- a/layouts/partials/hero/background.html +++ b/layouts/partials/hero/background.html @@ -41,7 +41,11 @@ style="background-image:url({{ .RelPermalink }});"> {{ end }} {{ else }} - {{ with .Resize "1200x" }} + {{ $filters := slice + images.AutoOrient + (images.Process "resize 1200x") + }} + {{ with images.Filter $filters . }}
{{ end }} diff --git a/layouts/partials/hero/basic.html b/layouts/partials/hero/basic.html index 4d01bb23..07b4a06e 100644 --- a/layouts/partials/hero/basic.html +++ b/layouts/partials/hero/basic.html @@ -26,7 +26,11 @@
{{ end }} {{ else }} - {{ with .Resize "1200x" }} + {{ $filters := slice + images.AutoOrient + (images.Process "resize 1200x") + }} + {{ with images.Filter $filters . }}
{{ end }} {{ end }} diff --git a/layouts/partials/hero/big.html b/layouts/partials/hero/big.html index 4b61b833..b7aa42f1 100644 --- a/layouts/partials/hero/big.html +++ b/layouts/partials/hero/big.html @@ -48,7 +48,11 @@ {{ end }} {{ else }} - {{ with .Resize "1200x" }} + {{ $filters := slice + images.AutoOrient + (images.Process "resize 1200x") + }} + {{ with images.Filter $filters . }}
{{ $alt }} {{ if $caption }} diff --git a/layouts/partials/hero/thumbAndBackground.html b/layouts/partials/hero/thumbAndBackground.html index 4b807ac1..db5b2b69 100644 --- a/layouts/partials/hero/thumbAndBackground.html +++ b/layouts/partials/hero/thumbAndBackground.html @@ -25,7 +25,11 @@
{{ end }} {{ else }} -{{ with .Resize "1200x" }} +{{ $filters := slice + images.AutoOrient + (images.Process "resize 1200x") +}} +{{ with images.Filter $filters . }}
{{ end }} {{ end }} @@ -44,7 +48,11 @@
{{ end }} {{ else }} -{{ with .Resize "1200x" }} +{{ $filters := slice + images.AutoOrient + (images.Process "resize 1200x") +}} +{{ with images.Filter $filters . }}
diff --git a/layouts/partials/term-link/card.html b/layouts/partials/term-link/card.html index 7f2e8adf..bc53f7d2 100644 --- a/layouts/partials/term-link/card.html +++ b/layouts/partials/term-link/card.html @@ -17,7 +17,11 @@
{{ end }} {{ else }} - {{ with .Resize "600x" }} + {{ $filters := slice + images.AutoOrient + (images.Process "resize 600x") + }} + {{ with images.Filter $filters . }}
{{ end }} {{ end }}