smartcrop

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Smartcrop

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

Smartcrop finds good rectangular image crops of a specific size. It uses https://github.com/muesli/smartcrop

func (*Smartcrop) Apply

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

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

func (Smartcrop) CaddyModule

func (Smartcrop) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Smartcrop) UnmarshalCaddyfile

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

UnmarshalCaddyfile configures the Smartcrop instance.

Syntax:

smartcrop <width> <height>

Parameters:

width must be a positive integer and determines the width of the cropped image.

height must be a positive integer and determines the height of the cropped image.

Jump to

Keyboard shortcuts

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