Some godoc adjustments and image struct renames

This commit is contained in:
Bjørn Erik Pedersen
2022-04-21 10:59:13 +02:00
parent 11047534e4
commit fa80fe3c8a
23 changed files with 193 additions and 90 deletions

View File

@@ -21,7 +21,6 @@ import (
"github.com/pkg/errors"
"github.com/gohugoio/hugo/resources/images"
"github.com/gohugoio/hugo/resources/resource"
// Importing image codecs for image.DecodeConfig
_ "image/gif"
@@ -92,12 +91,12 @@ func (ns *Namespace) Config(path any) (image.Config, error) {
return config, nil
}
func (ns *Namespace) Filter(args ...any) (resource.Image, error) {
func (ns *Namespace) Filter(args ...any) (images.ImageResource, error) {
if len(args) < 2 {
return nil, errors.New("must provide an image and one or more filters")
}
img := args[len(args)-1].(resource.Image)
img := args[len(args)-1].(images.ImageResource)
filtersv := args[:len(args)-1]
return img.Filter(filtersv...)