mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
parent
8adba648cc
commit
648d00c7d8
6 changed files with 509 additions and 6 deletions
52
docs/content/en/functions/images/AutoOrient.md
Normal file
52
docs/content/en/functions/images/AutoOrient.md
Normal file
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
title: images.AutoOrient
|
||||
description: Returns an image filter that rotates and flips an image as needed per its EXIF orientation tag.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
aliases: []
|
||||
related:
|
||||
- functions/images/Filter
|
||||
- methods/resource/Filter
|
||||
returnType: images.filter
|
||||
signatures: [images.AutoOrient]
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{< new-in 0.122.0 >}}
|
||||
|
||||
## Usage
|
||||
|
||||
Create the filter:
|
||||
|
||||
```go-html-template
|
||||
{{ $filter := images.AutoOrient }}
|
||||
```
|
||||
|
||||
{{% include "functions/images/_common/apply-image-filter.md" %}}
|
||||
|
||||
{{% note %}}
|
||||
When using with other filters, specify `images.AutoOrient` first.
|
||||
{{% /note %}}
|
||||
|
||||
```go-html-template
|
||||
{{ $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
|
||||
>}}
|
Loading…
Add table
Add a link
Reference in a new issue