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
type SmartcropFactory ¶
type SmartcropFactory struct{}
SmartcropFactory creates Crop instances.
func (SmartcropFactory) Name ¶
func (ff SmartcropFactory) Name() string
Name returns the name of the filter, which is also the directive used in the image filter block.
func (SmartcropFactory) New ¶
func (ff SmartcropFactory) New(args ...string) (imagefilter.Filter, error)
New initialises and returns a configured 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.
func (SmartcropFactory) Unmarshal ¶
func (ff SmartcropFactory) Unmarshal(data []byte) (imagefilter.Filter, error)
Unmarshal decodes JSON data and returns a Smartcrop instance.
Click to show internal directories.
Click to hide internal directories.