Skip to content

Commit

Permalink
resources/images: Create AutoOrient image filter
Browse files Browse the repository at this point in the history
Closes #11717
  • Loading branch information
jmooring authored and bep committed Dec 20, 2023
1 parent 8adba64 commit 648d00c
Show file tree
Hide file tree
Showing 6 changed files with 509 additions and 6 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions docs/content/en/functions/images/AutoOrient.md
@@ -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
>}}

0 comments on commit 648d00c

Please sign in to comment.