mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Add $image.Process
Which supports all the existing actions: resize, crop, fit, fill. But it also allows plain format conversions: ``` {{ $img = $img.Process "webp" }} ``` Which will be a simple re-encoding of the source image. Fixes #11483
This commit is contained in:
@@ -33,6 +33,9 @@ type ImageResourceOps interface {
|
||||
// Width returns the width of the Image.
|
||||
Width() int
|
||||
|
||||
// Process applies the given image processing options to the image.
|
||||
Process(spec string) (ImageResource, error)
|
||||
|
||||
// Crop an image to match the given dimensions without resizing.
|
||||
// You must provide both width and height.
|
||||
// Use the anchor option to change the crop box anchor point.
|
||||
|
Reference in New Issue
Block a user