mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Allow slices in the image Filter funcs, not just varargs
[ci skip] See #6255
This commit is contained in:
@@ -18,8 +18,6 @@ import (
|
||||
"image"
|
||||
"sync"
|
||||
|
||||
"github.com/disintegration/gift"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/gohugoio/hugo/resources/images"
|
||||
@@ -101,10 +99,6 @@ func (ns *Namespace) Filter(args ...interface{}) (resource.Image, error) {
|
||||
|
||||
img := args[len(args)-1].(resource.Image)
|
||||
filtersv := args[:len(args)-1]
|
||||
filters := make([]gift.Filter, len(filtersv))
|
||||
for i, f := range filtersv {
|
||||
filters[i] = f.(gift.Filter)
|
||||
}
|
||||
|
||||
return img.Filter(filters...)
|
||||
return img.Filter(filtersv...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user