1
0
Fork 0
hugo/docs/content/en/functions/images/AutoOrient.md

1004 B

title description categories keywords params
images.AutoOrient Returns an image filter that rotates and flips an image as needed per its EXIF orientation tag.
functions_and_methods
aliases returnType signatures
images.filter
images.AutoOrient

{{< new-in 0.121.2 />}}

Usage

Create the filter:

{{ $filter := images.AutoOrient }}

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

[!note] When using with other filters, specify images.AutoOrient first.

{{ $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

}}