Files
hugo/docs/content/en/functions/images/AutoOrient.md
Bjørn Erik Pedersen 5fd1e74903 Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
```
git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash
```

Closes #11925
2024-01-27 10:48:57 +01:00

1.0 KiB

title, description, categories, keywords, action, toc
title description categories keywords action toc
images.AutoOrient Returns an image filter that rotates and flips an image as needed per its EXIF orientation tag.
aliases related returnType signatures
functions/images/Filter
methods/resource/Filter
images.filter
images.AutoOrient
true

{{< new-in 0.121.2 >}}

Usage

Create the filter:

{{ $filter := images.AutoOrient }}

{{% include "functions/images/_common/apply-image-filter.md" %}}

{{% note %}} When using with other filters, specify images.AutoOrient first. {{% /note %}}

{{ $filters := slice
  images.AutoOrient
  (images.Process "resize 200x")
}}
{{ with resources.Get "images/original.jpg" }}
  {{ with images.Filter $filters . }}
    <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
  {{ end }}
{{ end }}

Example

{{< img src="images/examples/landscape-exif-orientation-5.jpg" alt="Zion National Park" filter="AutoOrient" filterArgs="" example=true

}}