From 3a9cb7b0fb1da71f1c051340bf746f29ab39cd7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 4 Oct 2022 11:00:07 +0200 Subject: resources/images: Fix 2 animated GIF resize issues * Fix resize of animated GIF when target != GIF * Avoid processing all GIF frames if targetFormat != GIF Fixes #10354 --- resources/image_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'resources/image_test.go') diff --git a/resources/image_test.go b/resources/image_test.go index 111ce66db..75a20f156 100644 --- a/resources/image_test.go +++ b/resources/image_test.go @@ -620,6 +620,8 @@ func TestImageOperationsGolden(t *testing.T) { // Note, if you're enabling this on a MacOS M1 (ARM) you need to run the test with GOARCH=amd64. // GOARCH=amd64 go test -timeout 30s -run "^TestImageOperationsGolden$" ./resources -v + // The above will print out a folder. + // Replace testdata/golden with resources/_gen/images in that folder. devMode := false testImages := []string{"sunset.jpg", "gohugoio8.png", "gohugoio24.png"} @@ -663,7 +665,7 @@ func TestImageOperationsGolden(t *testing.T) { // Animated GIF orig = fetchImageForSpec(spec, c, "giphy.gif") - for _, resizeSpec := range []string{"200x", "512x"} { + for _, resizeSpec := range []string{"200x", "512x", "100x jpg"} { resized, err := orig.Resize(resizeSpec) c.Assert(err, qt.IsNil) rel := resized.RelPermalink() -- cgit v1.2.3