resize

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resize

type Resize struct {
	Width  string `json:"width,omitempty"`
	Height string `json:"height,omitempty"`
}

Resize can downsize images. If upsizing of an image is detected, nothing will be done and the input image is returned unchanged.

func (*Resize) Apply

func (f *Resize) Apply(repl *caddy.Replacer, img image.Image) (image.Image, error)

Apply applies the image filter to an image and returns the new image.

func (Resize) CaddyModule

func (Resize) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Resize) UnmarshalCaddyfile

func (f *Resize) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile configures the Resize instance.

Syntax:

resize <width> <height>

Parameters:

width must be a positive integer and determines the maximum width.

height must be a positive integer and determines the maximum height.

Either width or height can be 0, then the image aspect ratio is preserved.

Jump to

Keyboard shortcuts

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