Allow slices in the image Filter funcs, not just varargs

[ci skip]

See #6255
This commit is contained in:
Bjørn Erik Pedersen
2019-09-04 14:07:10 +02:00
parent 529c7f1090
commit bb894ceaf8
8 changed files with 90 additions and 21 deletions

View File

@@ -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...)
}