Image resource refactor
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 18 Aug 2019 09:21:27 +0000 (11:21 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 26 Aug 2019 13:00:44 +0000 (15:00 +0200)
commitf9978ed16476ca6d233a89669c62c798cdf9db9d
tree02edb31008b997a3e77055060a34971fe9e8c5a4
parent58d4c0a8be8beefbd7437b17bf7a9a381164d09b
Image resource refactor

This commit pulls most of the image related logic into its own package, to make it easier to reason about and extend.

This is also a rewrite of the transformation logic used in Hugo Pipes, mostly to allow constructs like the one below:

    {{ ($myimg | fingerprint ).Width }}

Fixes #5903
Fixes #6234
Fixes #6266
35 files changed:
common/herrors/errors.go
htesting/test_helpers.go
hugolib/assets/images/sunset.jpg [new file with mode: 0644]
hugolib/pagebundler_test.go
hugolib/resource_chain_test.go
hugolib/testhelpers_test.go
resources/image.go
resources/image_cache.go
resources/image_test.go
resources/images/config.go [new file with mode: 0644]
resources/images/config_test.go [new file with mode: 0644]
resources/images/image.go [new file with mode: 0644]
resources/images/smartcrop.go [new file with mode: 0644]
resources/internal/key.go [new file with mode: 0644]
resources/internal/key_test.go [new file with mode: 0644]
resources/resource.go
resources/resource/resourcetypes.go
resources/resource_cache.go
resources/resource_metadata.go
resources/resource_metadata_test.go
resources/resource_spec.go [new file with mode: 0644]
resources/resource_test.go
resources/resource_transformers/htesting/testhelpers.go [new file with mode: 0644]
resources/resource_transformers/integrity/integrity.go
resources/resource_transformers/integrity/integrity_test.go
resources/resource_transformers/minifier/minify.go
resources/resource_transformers/minifier/minify_test.go [new file with mode: 0644]
resources/resource_transformers/postcss/postcss.go
resources/resource_transformers/templates/execute_as_template.go
resources/resource_transformers/tocss/scss/client.go
resources/smartcrop.go [deleted file]
resources/testhelpers_test.go
resources/transform.go
resources/transform_test.go
tpl/resources/resources.go