mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
Misc doc, code refactoring to improve documentation
This commit is contained in:
@@ -29,6 +29,7 @@ type ImageResource interface {
|
||||
type ImageResourceOps interface {
|
||||
// Height returns the height of the Image.
|
||||
Height() int
|
||||
|
||||
// Width returns the width of the Image.
|
||||
Width() int
|
||||
|
||||
@@ -37,8 +38,17 @@ type ImageResourceOps interface {
|
||||
// Use the anchor option to change the crop box anchor point.
|
||||
// {{ $image := $image.Crop "600x400" }}
|
||||
Crop(spec string) (ImageResource, error)
|
||||
|
||||
// Fill scales the image to the smallest possible size that will cover the specified dimensions in spec,
|
||||
// crops the resized image to the specified dimensions using the given anchor point.
|
||||
// The spec is space delimited, e.g. `200x300 TopLeft`.
|
||||
Fill(spec string) (ImageResource, error)
|
||||
|
||||
// Fit scales down the image using the given spec.
|
||||
Fit(spec string) (ImageResource, error)
|
||||
|
||||
// Resize resizes the image to the given spec. If one of width or height is 0, the image aspect
|
||||
// ratio is preserved.
|
||||
Resize(spec string) (ImageResource, error)
|
||||
|
||||
// Filter applies one or more filters to an Image.
|
||||
|
Reference in New Issue
Block a user