resize

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: 8 Imported by: 0

Documentation

Overview

Package resize provides methods for resizing images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResizeTransformation

func NewResizeTransformation(ctx context.Context, str_url string) (transform.Transformation, error)

NewResizeWriter returns a new `ResizeTransformation` instance configure by 'uri' in the form of:

resize://?max={MAX}

Where {MAX} is expected to be a maximum dimension for the resized image.

func ResizeImage

func ResizeImage(ctx context.Context, im image.Image, max int) (image.Image, error)

ResizeImages scaled and resizes 'im' return a new `image.Image` instance whose maximum dimension is 'max'.

Types

type ResizeTransformation

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

ResizeTransformation is a struct that implements the `Transformation` interface for resizing images by a maximum dimension.

func (*ResizeTransformation) Transform

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

Transform will resize '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