orient

package
v0.0.0-...-ecdbfc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package orient provides the Orient function that applies an Exif orientation to an image.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTranspose

func IsTranspose(o int) bool

IsTranspose reports if the Exif orientation o requires a transpose operation that swaps the x and y dimensions of the image.

In other words, it returns true iff o represents either rotation by ±90° or a transpose/transverse operation.

func Orient

func Orient(im image.Image, o int) image.Image

Orient changes the orientation of im based on the Exif orientation value.

It performes the following operation based on o:

2: flip horizontal
3: rotate 180°
4: flip vertical
5: transpose
6: rotate 90°
7: transverse (transpose and rotate 180°)
8: rotate 270°

It will return either a new image for the values of o above, or im istelf otherwise.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL