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:
Bjørn Erik Pedersen
2023-09-22 15:15:16 +02:00
parent c32094ace1
commit ef0e7149d6
13 changed files with 216 additions and 98 deletions

View File

@@ -100,6 +100,10 @@ func (e *errorResource) Width() int {
panic(e.ResourceError)
}
func (e *errorResource) Process(spec string) (images.ImageResource, error) {
panic(e.ResourceError)
}
func (e *errorResource) Crop(spec string) (images.ImageResource, error) {
panic(e.ResourceError)
}