rotate

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: BSD-3-Clause Imports: 10 Imported by: 2

Documentation

Overview

Package rotate provides methods for rotating images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageOrientation

func GetImageOrientation(ctx context.Context, r io.Reader) (string, error)

GetImageOrientation returns the string representation of the image orientation (0-8) in 'r'.

func NewRotateTransformation

func NewRotateTransformation(ctx context.Context, uri string) (transform.Transformation, error)

NewRotateWriter returns a new `RotateTransformation` instance configure by 'uri' in the form of:

rotate://?orientation={ORIENTATION}

Where {ORIENTATION} is expected to be a valid EXIF orientation string (1-8).

func RotateImageWithDegrees

func RotateImageWithDegrees(ctx context.Context, im image.Image, degrees float64) (image.Image, error)

RotateImageWithOrientation will rotate 'im' by 'degrees' degrees. Currently only values in units of 90 degrees or 0 are supported.

func RotateImageWithOrientation

func RotateImageWithOrientation(ctx context.Context, im image.Image, orientation string) (image.Image, error)

RotateImageWithOrientation will rotate 'im' based on EXIF orientation value defined in 'orientation'.

Types

type RotateTransformation

type RotateTransformation struct {
	transform.Transformation
	// contains filtered or unexported fields
}

RotateTransformation is a struct that implements the `Transformation` interface for rotating images.

func (*RotateTransformation) Transform

func (tr *RotateTransformation) Transform(ctx context.Context, im image.Image) (image.Image, error)

Transform will rotate 'im' and return a new `image.Image` instance.

Jump to

Keyboard shortcuts

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