images.AutoOrient
Syntax
images.AutoOrient
Returns
images.filter
Usage
Create the filter:
{{ $filter := images.AutoOrient }}
Apply the filter using the images.Filter
function:
{{ with resources.Get "images/original.jpg" }}
{{ with . | images.Filter $filter }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}
{{ end }}
You can also apply the filter using the Filter
method on a Resource
object:
{{ with resources.Get "images/original.jpg" }}
{{ with .Filter $filter }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}
{{ end }}
{{ $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
Original
![Zion National Park](/images/examples/landscape-exif-orientation-5_hu6f388a3eeb99d555a9ef70f6e5555f0a_38639_384x0_resize_q75_catmullrom.jpg)
Processed
![Zion National Park](/images/examples/landscape-exif-orientation-5_hu6f388a3eeb99d555a9ef70f6e5555f0a_38639_d2a6f6a45706237fc6c8d50723a5e784.jpg)