diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-02-27 18:29:15 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-02-27 18:29:15 +0100 |
commit | ba94abbf5dd90f989242af8a7027d67a572a6128 (patch) | |
tree | eb9bd09e1ac8c38a551cec0b5f681ca0d8bef0b0 /resource/image_test.go | |
parent | 55fb0eac2019cfa22d0e6a9770d36a14be8e4d99 (diff) |
resource: Fix SVG and similar resource handling
The validation of if we could process the image (resize etc.) was moved up in Hugo 0.37, which meant SVG and other "non-processable" images would fail.
This commit fixes that by creating a regular resource for these image formats. They will not have `.Resize` or any of the other image methods.
Fixes #4455
Diffstat (limited to 'resource/image_test.go')
-rw-r--r-- | resource/image_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/resource/image_test.go b/resource/image_test.go index 7906f4fbc..1e5b3d531 100644 --- a/resource/image_test.go +++ b/resource/image_test.go @@ -278,6 +278,13 @@ func TestImageResize8BitPNG(t *testing.T) { } +func TestSVGImage(t *testing.T) { + assert := require.New(t) + spec := newTestResourceSpec(assert) + svg := fetchResourceForSpec(spec, assert, "circle.svg") + assert.NotNil(svg) +} + func BenchmarkResizeParallel(b *testing.B) { assert := require.New(b) img := fetchSunset(assert) |