mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +02:00
Add a set of image filters
With this you can do variants of this: ``` {{ $img := resources.Get "images/misc/3-jenny.jpg" }} {{ $img := $img.Resize "300x" }} {{ $g1 := $img.Filter images.Grayscale }} {{ $g2 := $img | images.Filter (images.Saturate 30) (images.GaussianBlur 3) }} ``` Fixes #6255
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
package resource
|
||||
|
||||
import (
|
||||
"github.com/disintegration/gift"
|
||||
"github.com/gohugoio/hugo/langs"
|
||||
"github.com/gohugoio/hugo/media"
|
||||
|
||||
@@ -47,6 +48,7 @@ type ImageOps interface {
|
||||
Fill(spec string) (Image, error)
|
||||
Fit(spec string) (Image, error)
|
||||
Resize(spec string) (Image, error)
|
||||
Filter(filters ...gift.Filter) (Image, error)
|
||||
}
|
||||
|
||||
type ResourceTypesProvider interface {
|
||||
|
Reference in New Issue
Block a user