diff --git a/.gitignore b/.gitignore index a1fa54656..ddad69611 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ imports.* dist/ public/ +.DS_Store \ No newline at end of file diff --git a/htesting/test_helpers.go b/htesting/test_helpers.go index ff14de58d..2043b1a4b 100644 --- a/htesting/test_helpers.go +++ b/htesting/test_helpers.go @@ -110,6 +110,11 @@ func IsCI() bool { return (os.Getenv("CI") != "" || os.Getenv("CI_LOCAL") != "") && os.Getenv("CIRCLE_BRANCH") == "" } +// IsRealCI reports whether we're running in a CI server, but not in a local CI setup. +func IsRealCI() bool { + return IsCI() && os.Getenv("CI_LOCAL") == "" +} + // IsGitHubAction reports whether we're running in a GitHub Action. func IsGitHubAction() bool { return os.Getenv("GITHUB_ACTION") != "" diff --git a/hugolib/integrationtest_builder.go b/hugolib/integrationtest_builder.go index 1880aa62f..18785ce75 100644 --- a/hugolib/integrationtest_builder.go +++ b/hugolib/integrationtest_builder.go @@ -105,6 +105,12 @@ func TestOptWithOSFs() TestOpt { } } +func TestOptWithPrintAndKeepTempDir(b bool) TestOpt { + return func(c *IntegrationTestConfig) { + c.PrintAndKeepTempDir = b + } +} + // TestOptWithWorkingDir allows setting any config optiona as a function al option. func TestOptWithConfig(fn func(c *IntegrationTestConfig)) TestOpt { return func(c *IntegrationTestConfig) { diff --git a/resources/image_test.go b/resources/image_test.go index 5cebba837..5639d457e 100644 --- a/resources/image_test.go +++ b/resources/image_test.go @@ -16,30 +16,20 @@ package resources_test import ( "context" "fmt" - "image" - "image/gif" "io/fs" "math/rand" "os" - "path/filepath" - "runtime" "strconv" - "strings" "sync" "testing" "time" "github.com/bep/imagemeta" - "github.com/gohugoio/hugo/htesting" - "github.com/gohugoio/hugo/resources/images/webp" - "github.com/gohugoio/hugo/common/hashing" "github.com/gohugoio/hugo/common/paths" "github.com/spf13/afero" - "github.com/disintegration/gift" - "github.com/gohugoio/hugo/media" "github.com/gohugoio/hugo/resources/images" "github.com/google/go-cmp/cmp" @@ -533,320 +523,6 @@ func BenchmarkImageExif(b *testing.B) { }) } -// usesFMA indicates whether "fused multiply and add" (FMA) instruction is -// used. The command "grep FMADD go/test/codegen/floats.go" can help keep -// the FMA-using architecture list updated. -var usesFMA = runtime.GOARCH == "s390x" || - runtime.GOARCH == "ppc64" || - runtime.GOARCH == "ppc64le" || - runtime.GOARCH == "arm64" || - runtime.GOARCH == "riscv64" - -// goldenEqual compares two NRGBA images. It is used in golden tests only. -// A small tolerance is allowed on architectures using "fused multiply and add" -// (FMA) instruction to accommodate for floating-point rounding differences -// with control golden images that were generated on amd64 architecture. -// See https://golang.org/ref/spec#Floating_point_operators -// and https://github.com/gohugoio/hugo/issues/6387 for more information. -// -// Borrowed from https://github.com/disintegration/gift/blob/a999ff8d5226e5ab14b64a94fca07c4ac3f357cf/gift_test.go#L598-L625 -// Copyright (c) 2014-2019 Grigory Dryapak -// Licensed under the MIT License. -func goldenEqual(img1, img2 *image.NRGBA) bool { - maxDiff := 0 - if usesFMA { - maxDiff = 1 - } - if !img1.Rect.Eq(img2.Rect) { - return false - } - if len(img1.Pix) != len(img2.Pix) { - return false - } - for i := 0; i < len(img1.Pix); i++ { - diff := int(img1.Pix[i]) - int(img2.Pix[i]) - if diff < 0 { - diff = -diff - } - if diff > maxDiff { - return false - } - } - return true -} - -// Issue #8729 -func TestImageOperationsGoldenWebp(t *testing.T) { - if !htesting.IsCI() { - t.Skip("skip long running test in local mode") - } - if !webp.Supports() { - t.Skip("skip webp test") - } - c := qt.New(t) - c.Parallel() - - devMode := false - - testImages := []string{"fuzzy-cirlcle.png"} - - spec, workDir := newTestResourceOsFs(c) - defer func() { - if !devMode { - os.Remove(workDir) - } - }() - - if devMode { - fmt.Println(workDir) - } - - for _, imageName := range testImages { - image := fetchImageForSpec(spec, c, imageName) - imageWebp, err := image.Resize("200x webp") - c.Assert(err, qt.IsNil) - c.Assert(imageWebp.Width(), qt.Equals, 200) - } - - if devMode { - return - } - - dir1 := filepath.Join(workDir, "resources/_gen/images/a") - dir2 := filepath.FromSlash("testdata/golden_webp") - - assetGoldenDirs(c, dir1, dir2) -} - -func TestImageOperationsGolden(t *testing.T) { - if !htesting.IsCI() { - t.Skip("skip long running test in local mode") - } - c := qt.New(t) - c.Parallel() - - // Note, if you're enabling this on a MacOS M1 (ARM) you need to run the test with GOARCH=amd64. - // GOARCH=amd64 go test -count 1 -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"} - - spec, workDir := newTestResourceOsFs(c) - defer func() { - if !devMode { - os.Remove(workDir) - } - }() - - if devMode { - fmt.Println(workDir) - } - - gopher := fetchImageForSpec(spec, c, "gopher-hero8.png") - var err error - gopher, err = gopher.Resize("30x") - c.Assert(err, qt.IsNil) - - f := &images.Filters{} - - sunset := fetchImageForSpec(spec, c, "sunset.jpg") - - // Test PNGs with alpha channel. - for _, img := range []string{"gopher-hero8.png", "gradient-circle.png"} { - orig := fetchImageForSpec(spec, c, img) - for _, resizeSpec := range []string{"200x #e3e615", "200x jpg #e3e615"} { - resized, err := orig.Resize(resizeSpec) - c.Assert(err, qt.IsNil) - rel := resized.RelPermalink() - - c.Assert(rel, qt.Not(qt.Equals), "") - - } - - // Check the Opacity filter. - opacity30, err := orig.Filter(f.Opacity(30)) - c.Assert(err, qt.IsNil) - overlay, err := sunset.Filter(f.Overlay(opacity30.(images.ImageSource), 20, 20)) - c.Assert(err, qt.IsNil) - rel := overlay.RelPermalink() - c.Assert(rel, qt.Not(qt.Equals), "") - - } - - // A simple Gif file (no animation). - orig := fetchImageForSpec(spec, c, "gohugoio-card.gif") - for _, width := range []int{100, 220} { - resized, err := orig.Resize(fmt.Sprintf("%dx", width)) - c.Assert(err, qt.IsNil) - rel := resized.RelPermalink() - c.Assert(rel, qt.Not(qt.Equals), "") - c.Assert(resized.Width(), qt.Equals, width) - } - - // Animated GIF - orig = fetchImageForSpec(spec, c, "giphy.gif") - for _, resizeSpec := range []string{"200x", "512x", "100x jpg"} { - resized, err := orig.Resize(resizeSpec) - c.Assert(err, qt.IsNil) - rel := resized.RelPermalink() - c.Assert(rel, qt.Not(qt.Equals), "") - } - - for _, img := range testImages { - - orig := fetchImageForSpec(spec, c, img) - for _, resizeSpec := range []string{"200x100", "600x", "200x r90 q50 Box"} { - resized, err := orig.Resize(resizeSpec) - c.Assert(err, qt.IsNil) - rel := resized.RelPermalink() - c.Assert(rel, qt.Not(qt.Equals), "") - } - - for _, fillSpec := range []string{"300x200 Gaussian Smart", "100x100 Center", "300x100 TopLeft NearestNeighbor", "400x200 BottomLeft"} { - resized, err := orig.Fill(fillSpec) - c.Assert(err, qt.IsNil) - rel := resized.RelPermalink() - c.Assert(rel, qt.Not(qt.Equals), "") - } - - for _, fitSpec := range []string{"300x200 Linear"} { - resized, err := orig.Fit(fitSpec) - c.Assert(err, qt.IsNil) - rel := resized.RelPermalink() - c.Assert(rel, qt.Not(qt.Equals), "") - } - - filters := []gift.Filter{ - f.Grayscale(), - f.GaussianBlur(6), - f.Saturation(50), - f.Sepia(100), - f.Brightness(30), - f.ColorBalance(10, -10, -10), - f.Colorize(240, 50, 100), - f.Gamma(1.5), - f.UnsharpMask(1, 1, 0), - f.Sigmoid(0.5, 7), - f.Pixelate(5), - f.Invert(), - f.Hue(22), - f.Contrast(32.5), - f.Overlay(gopher.(images.ImageSource), 20, 30), - f.Text("No options"), - f.Text("This long text is to test line breaks. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."), - f.Text("Hugo rocks!", map[string]any{"x": 3, "y": 3, "size": 20, "color": "#fc03b1"}), - } - - resized, err := orig.Fill("400x200 center") - c.Assert(err, qt.IsNil) - - for _, filter := range filters { - resized, err := resized.Filter(filter) - c.Assert(err, qt.IsNil) - rel := resized.RelPermalink() - c.Assert(rel, qt.Not(qt.Equals), "") - } - - resized, err = resized.Filter(filters[0:4]) - c.Assert(err, qt.IsNil) - rel := resized.RelPermalink() - c.Assert(rel, qt.Not(qt.Equals), "") - } - - if devMode { - return - } - - dir1 := filepath.Join(workDir, "resources/_gen/images/a/") - dir2 := filepath.FromSlash("testdata/golden") - - assetGoldenDirs(c, dir1, dir2) -} - -func assetGoldenDirs(c *qt.C, dir1, dir2 string) { - // The two dirs above should now be the same. - dirinfos1, err := os.ReadDir(dir1) - c.Assert(err, qt.IsNil) - dirinfos2, err := os.ReadDir(dir2) - c.Assert(err, qt.IsNil) - c.Assert(len(dirinfos1), qt.Equals, len(dirinfos2)) - - for i, fi1 := range dirinfos1 { - fi2 := dirinfos2[i] - c.Assert(fi1.Name(), qt.Equals, fi2.Name(), qt.Commentf("i=%d", i)) - - f1, err := os.Open(filepath.Join(dir1, fi1.Name())) - c.Assert(err, qt.IsNil) - f2, err := os.Open(filepath.Join(dir2, fi2.Name())) - c.Assert(err, qt.IsNil) - - decodeAll := func(f *os.File) []image.Image { - var images []image.Image - - if strings.HasSuffix(f.Name(), ".gif") { - gif, err := gif.DecodeAll(f) - c.Assert(err, qt.IsNil) - images = make([]image.Image, len(gif.Image)) - for i, img := range gif.Image { - images[i] = img - } - } else { - img, _, err := image.Decode(f) - c.Assert(err, qt.IsNil) - images = append(images, img) - } - return images - } - - imgs1 := decodeAll(f1) - imgs2 := decodeAll(f2) - c.Assert(len(imgs1), qt.Equals, len(imgs2)) - - LOOP: - for i, img1 := range imgs1 { - img2 := imgs2[i] - nrgba1 := image.NewNRGBA(img1.Bounds()) - gift.New().Draw(nrgba1, img1) - nrgba2 := image.NewNRGBA(img2.Bounds()) - gift.New().Draw(nrgba2, img2) - - if !goldenEqual(nrgba1, nrgba2) { - switch fi1.Name() { - case "giphy_hu13007323561585908901.gif", - "gohugoio8_hu12690451569630232821.png", - "gohugoio8_hu1619987041333606118.png", - "gohugoio8_hu18164141965527013334.png": - c.Log("expectedly differs from golden due to dithering:", fi1.Name()) - default: - c.Errorf("resulting image differs from golden: %s", fi1.Name()) - break LOOP - } - } - } - - if !usesFMA { - c.Assert(fi1, eq, fi2) - - _, err = f1.Seek(0, 0) - c.Assert(err, qt.IsNil) - _, err = f2.Seek(0, 0) - c.Assert(err, qt.IsNil) - - hash1, _, err := hashing.XXHashFromReader(f1) - c.Assert(err, qt.IsNil) - hash2, _, err := hashing.XXHashFromReader(f2) - c.Assert(err, qt.IsNil) - - c.Assert(hash1, qt.Equals, hash2) - } - - f1.Close() - f2.Close() - } -} - func BenchmarkResizeParallel(b *testing.B) { c := qt.New(b) _, img := fetchSunset(c) diff --git a/resources/images/images_golden_integration_test.go b/resources/images/images_golden_integration_test.go new file mode 100644 index 000000000..3245f125a --- /dev/null +++ b/resources/images/images_golden_integration_test.go @@ -0,0 +1,320 @@ +// Copyright 2024 The Hugo Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package images_test + +import ( + "image" + "image/gif" + _ "image/jpeg" + "io/fs" + "os" + "path/filepath" + "runtime" + "strings" + "testing" + + "github.com/disintegration/gift" + qt "github.com/frankban/quicktest" + "github.com/gohugoio/hugo/common/hashing" + "github.com/gohugoio/hugo/common/hugio" + "github.com/gohugoio/hugo/htesting" + "github.com/gohugoio/hugo/hugofs" + "github.com/gohugoio/hugo/hugolib" + "github.com/google/go-cmp/cmp" +) + +var eq = qt.CmpEquals( + cmp.Comparer(func(p1, p2 os.FileInfo) bool { + return p1.Name() == p2.Name() && p1.Size() == p2.Size() && p1.IsDir() == p2.IsDir() + }), + cmp.Comparer(func(d1, d2 fs.DirEntry) bool { + p1, err1 := d1.Info() + p2, err2 := d2.Info() + if err1 != nil || err2 != nil { + return false + } + return p1.Name() == p2.Name() && p1.Size() == p2.Size() && p1.IsDir() == p2.IsDir() + }), +) + +var goldenOpts = struct { + // Toggle this to write golden files to disk. + // Note: Remember to set this to false before committing. + writeGoldenFiles bool + + // This will skip any assertions. Useful when adding new golden variants to a test. + devMode bool +}{ + writeGoldenFiles: false, + devMode: false, +} + +// Note, if you're enabling writeGoldenFiles on a MacOS ARM 64 you need to run the test with GOARCH=amd64, e.g. +// GOARCH=amd64 go test -count 1 -timeout 30s -run "^TestGolden" ./resources/images +func TestGoldenFiltersMisc(t *testing.T) { + t.Parallel() + + if skipGolden { + t.Skip("Skip golden test on this architecture") + } + + // Will be used to generate golden files. + name := "filters_misc" + + files := ` +-- hugo.toml -- +-- assets/rotate270.jpg -- +sourcefilename: ../testdata/exif/orientation6.jpg +-- assets/sunset.jpg -- +sourcefilename: ../testdata/sunset.jpg +-- assets/gopher.png -- +sourcefilename: ../testdata/gopher-hero8.png +-- layouts/index.html -- +Home. +{{ $sunset := resources.Get "sunset.jpg" }} +{{ $sunsetGrayscale := $sunset.Filter (images.Grayscale) }} +{{ $gopher := resources.Get "gopher.png" }} +{{ $overlayFilter := images.Overlay $gopher 20 20 }} + +{{ $textOpts := dict + "color" "#fbfaf5" + "linespacing" 8 + "size" 40 + "x" 25 + "y" 190 +}} + +{{/* These are sorted. */}} +{{ template "filters" (dict "name" "brightness-40.jpg" "img" $sunset "filters" (images.Brightness 40)) }} +{{ template "filters" (dict "name" "contrast-50.jpg" "img" $sunset "filters" (images.Contrast 50)) }} +{{ template "filters" (dict "name" "dither-default.jpg" "img" $sunset "filters" (images.Dither)) }} +{{ template "filters" (dict "name" "gamma-1.667.jpg" "img" $sunset "filters" (images.Gamma 1.667)) }} +{{ template "filters" (dict "name" "gaussianblur-5.jpg" "img" $sunset "filters" (images.GaussianBlur 5)) }} +{{ template "filters" (dict "name" "grayscale.jpg" "img" $sunset "filters" (images.Grayscale)) }} +{{ template "filters" (dict "name" "grayscale+colorize-180-50-20.jpg" "img" $sunset "filters" (slice images.Grayscale (images.Colorize 180 50 20))) }} +{{ template "filters" (dict "name" "colorbalance-180-50-20.jpg" "img" $sunset "filters" (images.ColorBalance 180 50 20)) }} +{{ template "filters" (dict "name" "hue--15.jpg" "img" $sunset "filters" (images.Hue -15)) }} +{{ template "filters" (dict "name" "invert.jpg" "img" $sunset "filters" (images.Invert)) }} +{{ template "filters" (dict "name" "opacity-0.65.jpg" "img" $sunset "filters" (images.Opacity 0.65)) }} +{{ template "filters" (dict "name" "overlay-20-20.jpg" "img" $sunset "filters" ($overlayFilter)) }} +{{ template "filters" (dict "name" "padding-20-40-#976941.jpg" "img" $sunset "filters" (images.Padding 20 40 "#976941" )) }} +{{ template "filters" (dict "name" "pixelate-10.jpg" "img" $sunset "filters" (images.Pixelate 10)) }} +{{ template "filters" (dict "name" "rotate270.jpg" "img" (resources.Get "rotate270.jpg") "filters" images.AutoOrient) }} +{{ template "filters" (dict "name" "saturation-65.jpg" "img" $sunset "filters" (images.Saturation 65)) }} +{{ template "filters" (dict "name" "sepia-80.jpg" "img" $sunsetGrayscale "filters" (images.Sepia 80)) }} +{{ template "filters" (dict "name" "sigmoid-0.6--4.jpg" "img" $sunset "filters" (images.Sigmoid 0.6 -4 )) }} +{{ template "filters" (dict "name" "text.jpg" "img" $sunset "filters" (images.Text "Hugo Rocks!" $textOpts )) }} +{{ template "filters" (dict "name" "unsharpmask.jpg" "img" $sunset "filters" (images.UnsharpMask 10 0.4 0.03)) }} + + +{{ define "filters"}} +{{ if lt (len (path.Ext .name)) 4 }} + {{ errorf "No extension in %q" .name }} +{{ end }} +{{ $img := .img.Filter .filters }} +{{ $name := printf "images/%s" .name }} +{{ with $img | resources.Copy $name }} +{{ .Publish }} +{{ end }} +{{ end }} +` + + runGolden(t, name, files) +} + +func TestGoldenProcessMisc(t *testing.T) { + t.Parallel() + + if skipGolden { + t.Skip("Skip golden test on this architecture") + } + + // Will be used to generate golden files. + name := "process_misc" + + files := ` +-- hugo.toml -- +-- assets/giphy.gif -- +sourcefilename: ../testdata/giphy.gif +-- assets/sunset.jpg -- +sourcefilename: ../testdata/sunset.jpg +-- assets/gopher.png -- +sourcefilename: ../testdata/gopher-hero8.png +-- layouts/index.html -- +Home. +{{ $sunset := resources.Get "sunset.jpg" }} +{{ $sunsetGrayscale := $sunset.Filter (images.Grayscale) }} +{{ $gopher := resources.Get "gopher.png" }} +{{ $giphy := resources.Get "giphy.gif" }} + + +{{/* These are sorted. The end file name will be created from the spec + extension, so make sure these are unique. */}} +{{ template "process" (dict "spec" "crop 500x200 smart" "img" $sunset) }} +{{ template "process" (dict "spec" "fill 500x200 smart" "img" $sunset) }} +{{ template "process" (dict "spec" "fit 500x200 smart" "img" $sunset) }} +{{ template "process" (dict "spec" "resize 100x100 gif" "img" $giphy) }} +{{ template "process" (dict "spec" "resize 100x100 r180" "img" $gopher) }} +{{ template "process" (dict "spec" "resize 300x300 jpg #b31280" "img" $gopher) }} + +{{ define "process"}} +{{ $img := .img.Process .spec }} +{{ $ext := path.Ext $img.RelPermalink }} +{{ $name := printf "images/%s%s" (.spec | anchorize) $ext }} +{{ with $img | resources.Copy $name }} +{{ .Publish }} +{{ end }} +{{ end }} +` + + runGolden(t, name, files) +} + +func runGolden(t testing.TB, name, files string) *hugolib.IntegrationTestBuilder { + t.Helper() + + c := hugolib.Test(t, files, hugolib.TestOptWithOSFs()) // hugolib.TestOptWithPrintAndKeepTempDir(true)) + c.AssertFileContent("public/index.html", "Home.") + + outputDir := filepath.Join(c.H.Conf.WorkingDir(), "public", "images") + goldenBaseDir := filepath.Join("testdata", "images_golden") + goldenDir := filepath.Join(goldenBaseDir, name) + if goldenOpts.writeGoldenFiles { + c.Assert(htesting.IsRealCI(), qt.IsFalse) + c.Assert(os.MkdirAll(goldenBaseDir, 0o777), qt.IsNil) + c.Assert(os.RemoveAll(goldenDir), qt.IsNil) + c.Assert(hugio.CopyDir(hugofs.Os, outputDir, goldenDir, nil), qt.IsNil) + return c + } + + if goldenOpts.devMode { + c.Assert(htesting.IsRealCI(), qt.IsFalse) + return c + } + + decodeAll := func(f *os.File) []image.Image { + c.Helper() + + var images []image.Image + + if strings.HasSuffix(f.Name(), ".gif") { + gif, err := gif.DecodeAll(f) + c.Assert(err, qt.IsNil, qt.Commentf(f.Name())) + images = make([]image.Image, len(gif.Image)) + for i, img := range gif.Image { + images[i] = img + } + } else { + img, _, err := image.Decode(f) + c.Assert(err, qt.IsNil, qt.Commentf(f.Name())) + images = append(images, img) + } + return images + } + + entries1, err := os.ReadDir(outputDir) + c.Assert(err, qt.IsNil) + entries2, err := os.ReadDir(goldenDir) + c.Assert(err, qt.IsNil) + c.Assert(len(entries1), qt.Equals, len(entries2)) + for i, e1 := range entries1 { + c.Assert(filepath.Ext(e1.Name()), qt.Not(qt.Equals), "") + func() { + e2 := entries2[i] + + f1, err := os.Open(filepath.Join(outputDir, e1.Name())) + c.Assert(err, qt.IsNil) + defer f1.Close() + + f2, err := os.Open(filepath.Join(goldenDir, e2.Name())) + c.Assert(err, qt.IsNil) + defer f2.Close() + + imgs2 := decodeAll(f2) + imgs1 := decodeAll(f1) + c.Assert(len(imgs1), qt.Equals, len(imgs2)) + + if !usesFMA { + c.Assert(e1, eq, e2) + _, err = f1.Seek(0, 0) + c.Assert(err, qt.IsNil) + _, err = f2.Seek(0, 0) + c.Assert(err, qt.IsNil) + + hash1, _, err := hashing.XXHashFromReader(f1) + c.Assert(err, qt.IsNil) + hash2, _, err := hashing.XXHashFromReader(f2) + c.Assert(err, qt.IsNil) + + c.Assert(hash1, qt.Equals, hash2) + } + + for i, img1 := range imgs1 { + img2 := imgs2[i] + nrgba1 := image.NewNRGBA(img1.Bounds()) + gift.New().Draw(nrgba1, img1) + nrgba2 := image.NewNRGBA(img2.Bounds()) + gift.New().Draw(nrgba2, img2) + c.Assert(goldenEqual(nrgba1, nrgba2), qt.Equals, true, qt.Commentf(e1.Name())) + } + }() + } + return c +} + +// goldenEqual compares two NRGBA images. It is used in golden tests only. +// A small tolerance is allowed on architectures using "fused multiply and add" +// (FMA) instruction to accommodate for floating-point rounding differences +// with control golden images that were generated on amd64 architecture. +// See https://golang.org/ref/spec#Floating_point_operators +// and https://github.com/gohugoio/hugo/issues/6387 for more information. +// +// Based on https://github.com/disintegration/gift/blob/a999ff8d5226e5ab14b64a94fca07c4ac3f357cf/gift_test.go#L598-L625 +// Copyright (c) 2014-2019 Grigory Dryapak +// Licensed under the MIT License. +func goldenEqual(img1, img2 *image.NRGBA) bool { + maxDiff := 0 + if runtime.GOARCH != "amd64" { + // The golden files are created using the AMD64 architecture. + // Be lenient on other platforms due to floaging point and dithering differences. + maxDiff = 15 + } + if !img1.Rect.Eq(img2.Rect) { + return false + } + if len(img1.Pix) != len(img2.Pix) { + return false + } + for i := 0; i < len(img1.Pix); i++ { + diff := int(img1.Pix[i]) - int(img2.Pix[i]) + if diff < 0 { + diff = -diff + } + if diff > maxDiff { + return false + } + } + return true +} + +// We don't have a CI test environment for these, and there are known dithering issues that makes these time consuming to maintain. +var skipGolden = runtime.GOARCH == "ppc64" || runtime.GOARCH == "ppc64le" || runtime.GOARCH == "s390x" + +// usesFMA indicates whether "fused multiply and add" (FMA) instruction is +// used. The command "grep FMADD go/test/codegen/floats.go" can help keep +// the FMA-using architecture list updated. +var usesFMA = runtime.GOARCH == "s390x" || + runtime.GOARCH == "ppc64" || + runtime.GOARCH == "ppc64le" || + runtime.GOARCH == "arm64" || + runtime.GOARCH == "riscv64" diff --git a/resources/images/testdata/images_golden/filters_misc/brightness-40.jpg b/resources/images/testdata/images_golden/filters_misc/brightness-40.jpg new file mode 100644 index 000000000..a9aa6540b Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/brightness-40.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/colorbalance-180-50-20.jpg b/resources/images/testdata/images_golden/filters_misc/colorbalance-180-50-20.jpg new file mode 100644 index 000000000..875ec7aca Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/colorbalance-180-50-20.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/contrast-50.jpg b/resources/images/testdata/images_golden/filters_misc/contrast-50.jpg new file mode 100644 index 000000000..3aeef7b86 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/contrast-50.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/dither-default.jpg b/resources/images/testdata/images_golden/filters_misc/dither-default.jpg new file mode 100644 index 000000000..f5a26a7b6 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/dither-default.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/gamma-1.667.jpg b/resources/images/testdata/images_golden/filters_misc/gamma-1.667.jpg new file mode 100644 index 000000000..6998b8889 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/gamma-1.667.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/gaussianblur-5.jpg b/resources/images/testdata/images_golden/filters_misc/gaussianblur-5.jpg new file mode 100644 index 000000000..c363f7444 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/gaussianblur-5.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/grayscale+colorize-180-50-20.jpg b/resources/images/testdata/images_golden/filters_misc/grayscale+colorize-180-50-20.jpg new file mode 100644 index 000000000..32b4616cf Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/grayscale+colorize-180-50-20.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/grayscale.jpg b/resources/images/testdata/images_golden/filters_misc/grayscale.jpg new file mode 100644 index 000000000..6db57fee5 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/grayscale.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/hue--15.jpg b/resources/images/testdata/images_golden/filters_misc/hue--15.jpg new file mode 100644 index 000000000..150cd007e Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/hue--15.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/invert.jpg b/resources/images/testdata/images_golden/filters_misc/invert.jpg new file mode 100644 index 000000000..a2cf0cf82 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/invert.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/opacity-0.65.jpg b/resources/images/testdata/images_golden/filters_misc/opacity-0.65.jpg new file mode 100644 index 000000000..1198857f6 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/opacity-0.65.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/overlay-20-20.jpg b/resources/images/testdata/images_golden/filters_misc/overlay-20-20.jpg new file mode 100644 index 000000000..1c8963f42 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/overlay-20-20.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/padding-20-40-#976941.jpg b/resources/images/testdata/images_golden/filters_misc/padding-20-40-#976941.jpg new file mode 100644 index 000000000..f0ac22de7 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/padding-20-40-#976941.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/pixelate-10.jpg b/resources/images/testdata/images_golden/filters_misc/pixelate-10.jpg new file mode 100644 index 000000000..a181a73ec Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/pixelate-10.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/rotate270.jpg b/resources/images/testdata/images_golden/filters_misc/rotate270.jpg new file mode 100644 index 000000000..3a5b2483a Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/rotate270.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/saturation-65.jpg b/resources/images/testdata/images_golden/filters_misc/saturation-65.jpg new file mode 100644 index 000000000..db33a7b25 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/saturation-65.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/sepia-80.jpg b/resources/images/testdata/images_golden/filters_misc/sepia-80.jpg new file mode 100644 index 000000000..8b79d34f9 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/sepia-80.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/sigmoid-0.6--4.jpg b/resources/images/testdata/images_golden/filters_misc/sigmoid-0.6--4.jpg new file mode 100644 index 000000000..9dff50a22 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/sigmoid-0.6--4.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/text.jpg b/resources/images/testdata/images_golden/filters_misc/text.jpg new file mode 100644 index 000000000..1c3082bbe Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/text.jpg differ diff --git a/resources/images/testdata/images_golden/filters_misc/unsharpmask.jpg b/resources/images/testdata/images_golden/filters_misc/unsharpmask.jpg new file mode 100644 index 000000000..75164c3f6 Binary files /dev/null and b/resources/images/testdata/images_golden/filters_misc/unsharpmask.jpg differ diff --git a/resources/images/testdata/images_golden/process_misc/crop-500x200-smart.jpg b/resources/images/testdata/images_golden/process_misc/crop-500x200-smart.jpg new file mode 100644 index 000000000..6df66064b Binary files /dev/null and b/resources/images/testdata/images_golden/process_misc/crop-500x200-smart.jpg differ diff --git a/resources/images/testdata/images_golden/process_misc/fill-500x200-smart.jpg b/resources/images/testdata/images_golden/process_misc/fill-500x200-smart.jpg new file mode 100644 index 000000000..cad8927b5 Binary files /dev/null and b/resources/images/testdata/images_golden/process_misc/fill-500x200-smart.jpg differ diff --git a/resources/images/testdata/images_golden/process_misc/fit-500x200-smart.jpg b/resources/images/testdata/images_golden/process_misc/fit-500x200-smart.jpg new file mode 100644 index 000000000..a320cda99 Binary files /dev/null and b/resources/images/testdata/images_golden/process_misc/fit-500x200-smart.jpg differ diff --git a/resources/images/testdata/images_golden/process_misc/resize-100x100-gif.gif b/resources/images/testdata/images_golden/process_misc/resize-100x100-gif.gif new file mode 100644 index 000000000..66a6b73de Binary files /dev/null and b/resources/images/testdata/images_golden/process_misc/resize-100x100-gif.gif differ diff --git a/resources/images/testdata/images_golden/process_misc/resize-100x100-r180.png b/resources/images/testdata/images_golden/process_misc/resize-100x100-r180.png new file mode 100644 index 000000000..ec5042e67 Binary files /dev/null and b/resources/images/testdata/images_golden/process_misc/resize-100x100-r180.png differ diff --git a/resources/images/testdata/images_golden/process_misc/resize-300x300-jpg-b31280.jpg b/resources/images/testdata/images_golden/process_misc/resize-300x300-jpg-b31280.jpg new file mode 100644 index 000000000..1000d8f34 Binary files /dev/null and b/resources/images/testdata/images_golden/process_misc/resize-300x300-jpg-b31280.jpg differ diff --git a/resources/testdata/golden/giphy_hu13007323561585908901.gif b/resources/testdata/golden/giphy_hu13007323561585908901.gif deleted file mode 100644 index ca826432c..000000000 Binary files a/resources/testdata/golden/giphy_hu13007323561585908901.gif and /dev/null differ diff --git a/resources/testdata/golden/giphy_hu15867760255711130632.gif b/resources/testdata/golden/giphy_hu15867760255711130632.gif deleted file mode 100644 index 590d2a780..000000000 Binary files a/resources/testdata/golden/giphy_hu15867760255711130632.gif and /dev/null differ diff --git a/resources/testdata/golden/giphy_hu6128044492074974243.jpg b/resources/testdata/golden/giphy_hu6128044492074974243.jpg deleted file mode 100644 index c55e5d3ad..000000000 Binary files a/resources/testdata/golden/giphy_hu6128044492074974243.jpg and /dev/null differ diff --git a/resources/testdata/golden/gohugoio-card_hu2987156907072306909.gif b/resources/testdata/golden/gohugoio-card_hu2987156907072306909.gif deleted file mode 100644 index c4b39b041..000000000 Binary files a/resources/testdata/golden/gohugoio-card_hu2987156907072306909.gif and /dev/null differ diff --git a/resources/testdata/golden/gohugoio-card_hu5424444801046891674.gif b/resources/testdata/golden/gohugoio-card_hu5424444801046891674.gif deleted file mode 100644 index 7d810c1f9..000000000 Binary files a/resources/testdata/golden/gohugoio-card_hu5424444801046891674.gif and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu10797171466856050177.png b/resources/testdata/golden/gohugoio24_hu10797171466856050177.png deleted file mode 100644 index 32c5b49d8..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu10797171466856050177.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu11107750106104480197.png b/resources/testdata/golden/gohugoio24_hu11107750106104480197.png deleted file mode 100644 index dde14757c..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu11107750106104480197.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu11329286024190801059.png b/resources/testdata/golden/gohugoio24_hu11329286024190801059.png deleted file mode 100644 index ce791767f..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu11329286024190801059.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu12210858383293148143.png b/resources/testdata/golden/gohugoio24_hu12210858383293148143.png deleted file mode 100644 index c1a64b59f..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu12210858383293148143.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu13086833506724393086.png b/resources/testdata/golden/gohugoio24_hu13086833506724393086.png deleted file mode 100644 index 76deeabc7..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu13086833506724393086.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu13525767338321336398.png b/resources/testdata/golden/gohugoio24_hu13525767338321336398.png deleted file mode 100644 index 0991ca984..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu13525767338321336398.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu1369355309314118179.png b/resources/testdata/golden/gohugoio24_hu1369355309314118179.png deleted file mode 100644 index 174649232..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu1369355309314118179.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu1400913850517810505.png b/resources/testdata/golden/gohugoio24_hu1400913850517810505.png deleted file mode 100644 index 93f8dfda2..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu1400913850517810505.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu14141684530559227507.png b/resources/testdata/golden/gohugoio24_hu14141684530559227507.png deleted file mode 100644 index 28028b72d..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu14141684530559227507.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu14186438102343930541.png b/resources/testdata/golden/gohugoio24_hu14186438102343930541.png deleted file mode 100644 index 603b95ae0..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu14186438102343930541.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu15334383941700802690.png b/resources/testdata/golden/gohugoio24_hu15334383941700802690.png deleted file mode 100644 index 0ce82e49c..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu15334383941700802690.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu16565102657258557500.png b/resources/testdata/golden/gohugoio24_hu16565102657258557500.png deleted file mode 100644 index 4ef633564..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu16565102657258557500.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu17044066173912896721.png b/resources/testdata/golden/gohugoio24_hu17044066173912896721.png deleted file mode 100644 index 362be673b..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu17044066173912896721.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu17704168266634609966.png b/resources/testdata/golden/gohugoio24_hu17704168266634609966.png deleted file mode 100644 index a48a0f25a..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu17704168266634609966.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu18417462639738980704.png b/resources/testdata/golden/gohugoio24_hu18417462639738980704.png deleted file mode 100644 index 697ac914e..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu18417462639738980704.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu2731125086148712886.png b/resources/testdata/golden/gohugoio24_hu2731125086148712886.png deleted file mode 100644 index 76deeabc7..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu2731125086148712886.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu281918710943920862.png b/resources/testdata/golden/gohugoio24_hu281918710943920862.png deleted file mode 100644 index eba4b1e66..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu281918710943920862.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu3440533624707313030.png b/resources/testdata/golden/gohugoio24_hu3440533624707313030.png deleted file mode 100644 index 841d369ef..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu3440533624707313030.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu4079163993667427623.png b/resources/testdata/golden/gohugoio24_hu4079163993667427623.png deleted file mode 100644 index 25ac82485..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu4079163993667427623.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu4425915891794988430.png b/resources/testdata/golden/gohugoio24_hu4425915891794988430.png deleted file mode 100644 index dd11ce7ed..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu4425915891794988430.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu4576019605973288331.png b/resources/testdata/golden/gohugoio24_hu4576019605973288331.png deleted file mode 100644 index 5abf378b4..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu4576019605973288331.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu4640928585673549425.png b/resources/testdata/golden/gohugoio24_hu4640928585673549425.png deleted file mode 100644 index cd56200ea..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu4640928585673549425.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu5007208529579570920.png b/resources/testdata/golden/gohugoio24_hu5007208529579570920.png deleted file mode 100644 index d2f0afd27..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu5007208529579570920.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu5216349243587511129.png b/resources/testdata/golden/gohugoio24_hu5216349243587511129.png deleted file mode 100644 index 46fa3fd1b..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu5216349243587511129.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu578735004461910616.png b/resources/testdata/golden/gohugoio24_hu578735004461910616.png deleted file mode 100644 index 2fece7804..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu578735004461910616.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu5858624748295381298.png b/resources/testdata/golden/gohugoio24_hu5858624748295381298.png deleted file mode 100644 index 50fae767a..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu5858624748295381298.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu7784426158237953794.png b/resources/testdata/golden/gohugoio24_hu7784426158237953794.png deleted file mode 100644 index 056648a74..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu7784426158237953794.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio24_hu7862113105739619058.png b/resources/testdata/golden/gohugoio24_hu7862113105739619058.png deleted file mode 100644 index 5ad74bf79..000000000 Binary files a/resources/testdata/golden/gohugoio24_hu7862113105739619058.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu11148399329171024835.png b/resources/testdata/golden/gohugoio8_hu11148399329171024835.png deleted file mode 100644 index 156b42f43..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu11148399329171024835.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu11427867868933654094.png b/resources/testdata/golden/gohugoio8_hu11427867868933654094.png deleted file mode 100644 index 69aa35885..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu11427867868933654094.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu1162986745985451229.png b/resources/testdata/golden/gohugoio8_hu1162986745985451229.png deleted file mode 100644 index 0b914391c..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu1162986745985451229.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu11638877035372353818.png b/resources/testdata/golden/gohugoio8_hu11638877035372353818.png deleted file mode 100644 index c96e04108..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu11638877035372353818.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu1217888005047574594.png b/resources/testdata/golden/gohugoio8_hu1217888005047574594.png deleted file mode 100644 index 37dc0f798..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu1217888005047574594.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu12220589162864061188.png b/resources/testdata/golden/gohugoio8_hu12220589162864061188.png deleted file mode 100644 index 1a229a429..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu12220589162864061188.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu12690451569630232821.png b/resources/testdata/golden/gohugoio8_hu12690451569630232821.png deleted file mode 100644 index 51f6cfa7e..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu12690451569630232821.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu12777352499229939257.png b/resources/testdata/golden/gohugoio8_hu12777352499229939257.png deleted file mode 100644 index acde6a0f7..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu12777352499229939257.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu13982221718330949681.png b/resources/testdata/golden/gohugoio8_hu13982221718330949681.png deleted file mode 100644 index acde6a0f7..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu13982221718330949681.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu14107602960808127665.png b/resources/testdata/golden/gohugoio8_hu14107602960808127665.png deleted file mode 100644 index c29c6e613..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu14107602960808127665.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu14156562190479686537.png b/resources/testdata/golden/gohugoio8_hu14156562190479686537.png deleted file mode 100644 index 414acff3b..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu14156562190479686537.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu14592039178820708584.png b/resources/testdata/golden/gohugoio8_hu14592039178820708584.png deleted file mode 100644 index 1fa2bc9de..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu14592039178820708584.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu14839804078094713214.png b/resources/testdata/golden/gohugoio8_hu14839804078094713214.png deleted file mode 100644 index 64b0b3f7a..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu14839804078094713214.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu1619987041333606118.png b/resources/testdata/golden/gohugoio8_hu1619987041333606118.png deleted file mode 100644 index 2def214c8..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu1619987041333606118.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu17499078314270725360.png b/resources/testdata/golden/gohugoio8_hu17499078314270725360.png deleted file mode 100644 index a5852e14c..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu17499078314270725360.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu18164141965527013334.png b/resources/testdata/golden/gohugoio8_hu18164141965527013334.png deleted file mode 100644 index c8f782598..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu18164141965527013334.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu3062751268037078239.png b/resources/testdata/golden/gohugoio8_hu3062751268037078239.png deleted file mode 100644 index 53dd0b224..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu3062751268037078239.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu3419127525388578393.png b/resources/testdata/golden/gohugoio8_hu3419127525388578393.png deleted file mode 100644 index 0eef0aaf3..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu3419127525388578393.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu3589035650602432929.png b/resources/testdata/golden/gohugoio8_hu3589035650602432929.png deleted file mode 100644 index 7134de473..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu3589035650602432929.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu5613016746654861839.png b/resources/testdata/golden/gohugoio8_hu5613016746654861839.png deleted file mode 100644 index 09d991972..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu5613016746654861839.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu5911891014248513491.png b/resources/testdata/golden/gohugoio8_hu5911891014248513491.png deleted file mode 100644 index 6ddb55158..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu5911891014248513491.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu5964606204514209824.png b/resources/testdata/golden/gohugoio8_hu5964606204514209824.png deleted file mode 100644 index 08eccf7cd..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu5964606204514209824.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu7954024233587195445.png b/resources/testdata/golden/gohugoio8_hu7954024233587195445.png deleted file mode 100644 index 40fffa23a..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu7954024233587195445.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu8497843748973739779.png b/resources/testdata/golden/gohugoio8_hu8497843748973739779.png deleted file mode 100644 index c35f00722..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu8497843748973739779.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu8680424146433003017.png b/resources/testdata/golden/gohugoio8_hu8680424146433003017.png deleted file mode 100644 index 162dc4ec9..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu8680424146433003017.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu881093787809754101.png b/resources/testdata/golden/gohugoio8_hu881093787809754101.png deleted file mode 100644 index 0660c20d7..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu881093787809754101.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu9175902413241406055.png b/resources/testdata/golden/gohugoio8_hu9175902413241406055.png deleted file mode 100644 index 795a608e8..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu9175902413241406055.png and /dev/null differ diff --git a/resources/testdata/golden/gohugoio8_hu971124074666261597.png b/resources/testdata/golden/gohugoio8_hu971124074666261597.png deleted file mode 100644 index 325c31acd..000000000 Binary files a/resources/testdata/golden/gohugoio8_hu971124074666261597.png and /dev/null differ diff --git a/resources/testdata/golden/gopher-hero8_hu18029321441728138356.jpg b/resources/testdata/golden/gopher-hero8_hu18029321441728138356.jpg deleted file mode 100644 index 17fca6e6a..000000000 Binary files a/resources/testdata/golden/gopher-hero8_hu18029321441728138356.jpg and /dev/null differ diff --git a/resources/testdata/golden/gopher-hero8_hu7599356179908845799.png b/resources/testdata/golden/gopher-hero8_hu7599356179908845799.png deleted file mode 100644 index 935c2391b..000000000 Binary files a/resources/testdata/golden/gopher-hero8_hu7599356179908845799.png and /dev/null differ diff --git a/resources/testdata/golden/gopher-hero8_hu8339547226364980332.png b/resources/testdata/golden/gopher-hero8_hu8339547226364980332.png deleted file mode 100644 index 50c55c9eb..000000000 Binary files a/resources/testdata/golden/gopher-hero8_hu8339547226364980332.png and /dev/null differ diff --git a/resources/testdata/golden/gopher-hero8_hu9718283601959448032.png b/resources/testdata/golden/gopher-hero8_hu9718283601959448032.png deleted file mode 100644 index eb9f1170c..000000000 Binary files a/resources/testdata/golden/gopher-hero8_hu9718283601959448032.png and /dev/null differ diff --git a/resources/testdata/golden/gradient-circle_hu13051041682786618472.jpg b/resources/testdata/golden/gradient-circle_hu13051041682786618472.jpg deleted file mode 100644 index 56642d7e1..000000000 Binary files a/resources/testdata/golden/gradient-circle_hu13051041682786618472.jpg and /dev/null differ diff --git a/resources/testdata/golden/gradient-circle_hu2995269612296002085.png b/resources/testdata/golden/gradient-circle_hu2995269612296002085.png deleted file mode 100644 index fe39286bd..000000000 Binary files a/resources/testdata/golden/gradient-circle_hu2995269612296002085.png and /dev/null differ diff --git a/resources/testdata/golden/gradient-circle_hu4182458540361883551.png b/resources/testdata/golden/gradient-circle_hu4182458540361883551.png deleted file mode 100644 index b01efee50..000000000 Binary files a/resources/testdata/golden/gradient-circle_hu4182458540361883551.png and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu10303518067937744186.jpg b/resources/testdata/golden/sunset_hu10303518067937744186.jpg deleted file mode 100644 index 05d98c67a..000000000 Binary files a/resources/testdata/golden/sunset_hu10303518067937744186.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu10327704110867657089.jpg b/resources/testdata/golden/sunset_hu10327704110867657089.jpg deleted file mode 100644 index 9a6255687..000000000 Binary files a/resources/testdata/golden/sunset_hu10327704110867657089.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu10555571028775464444.jpg b/resources/testdata/golden/sunset_hu10555571028775464444.jpg deleted file mode 100644 index a5ad199d8..000000000 Binary files a/resources/testdata/golden/sunset_hu10555571028775464444.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu10706797811022665574.jpg b/resources/testdata/golden/sunset_hu10706797811022665574.jpg deleted file mode 100644 index e77e78d7b..000000000 Binary files a/resources/testdata/golden/sunset_hu10706797811022665574.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu1184697552324640242.jpg b/resources/testdata/golden/sunset_hu1184697552324640242.jpg deleted file mode 100644 index 3801c17d9..000000000 Binary files a/resources/testdata/golden/sunset_hu1184697552324640242.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu13997988183102182682.jpg b/resources/testdata/golden/sunset_hu13997988183102182682.jpg deleted file mode 100644 index 7e2bdeef0..000000000 Binary files a/resources/testdata/golden/sunset_hu13997988183102182682.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu14647978205320151651.jpg b/resources/testdata/golden/sunset_hu14647978205320151651.jpg deleted file mode 100644 index bc43f4ef9..000000000 Binary files a/resources/testdata/golden/sunset_hu14647978205320151651.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu1508817148191451926.jpg b/resources/testdata/golden/sunset_hu1508817148191451926.jpg deleted file mode 100644 index 1857f8758..000000000 Binary files a/resources/testdata/golden/sunset_hu1508817148191451926.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu15092417974014570823.jpg b/resources/testdata/golden/sunset_hu15092417974014570823.jpg deleted file mode 100644 index 8ac3b2524..000000000 Binary files a/resources/testdata/golden/sunset_hu15092417974014570823.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu15553011452282641860.jpg b/resources/testdata/golden/sunset_hu15553011452282641860.jpg deleted file mode 100644 index b2db97485..000000000 Binary files a/resources/testdata/golden/sunset_hu15553011452282641860.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu16406839322505000040.jpg b/resources/testdata/golden/sunset_hu16406839322505000040.jpg deleted file mode 100644 index 17a5927e2..000000000 Binary files a/resources/testdata/golden/sunset_hu16406839322505000040.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu17096332274161262571.jpg b/resources/testdata/golden/sunset_hu17096332274161262571.jpg deleted file mode 100644 index 2aa3dad2b..000000000 Binary files a/resources/testdata/golden/sunset_hu17096332274161262571.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu17735388202135872885.jpg b/resources/testdata/golden/sunset_hu17735388202135872885.jpg deleted file mode 100644 index 80f06bf66..000000000 Binary files a/resources/testdata/golden/sunset_hu17735388202135872885.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu18138233340135699657.jpg b/resources/testdata/golden/sunset_hu18138233340135699657.jpg deleted file mode 100644 index 03de912fb..000000000 Binary files a/resources/testdata/golden/sunset_hu18138233340135699657.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu18339759113732359089.jpg b/resources/testdata/golden/sunset_hu18339759113732359089.jpg deleted file mode 100644 index 1e2cb535b..000000000 Binary files a/resources/testdata/golden/sunset_hu18339759113732359089.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu1940616730388248148.jpg b/resources/testdata/golden/sunset_hu1940616730388248148.jpg deleted file mode 100644 index b425b0d92..000000000 Binary files a/resources/testdata/golden/sunset_hu1940616730388248148.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu2317318497170846135.jpg b/resources/testdata/golden/sunset_hu2317318497170846135.jpg deleted file mode 100644 index 9688c99c3..000000000 Binary files a/resources/testdata/golden/sunset_hu2317318497170846135.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu2620328362006291004.jpg b/resources/testdata/golden/sunset_hu2620328362006291004.jpg deleted file mode 100644 index 0b7d4e5d0..000000000 Binary files a/resources/testdata/golden/sunset_hu2620328362006291004.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu3329557056351636779.jpg b/resources/testdata/golden/sunset_hu3329557056351636779.jpg deleted file mode 100644 index b67650061..000000000 Binary files a/resources/testdata/golden/sunset_hu3329557056351636779.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu3528013170819345965.jpg b/resources/testdata/golden/sunset_hu3528013170819345965.jpg deleted file mode 100644 index 6c3da1385..000000000 Binary files a/resources/testdata/golden/sunset_hu3528013170819345965.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu4475169669413030903.jpg b/resources/testdata/golden/sunset_hu4475169669413030903.jpg deleted file mode 100644 index f12dd18fc..000000000 Binary files a/resources/testdata/golden/sunset_hu4475169669413030903.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu4645485093540451131.jpg b/resources/testdata/golden/sunset_hu4645485093540451131.jpg deleted file mode 100644 index 41b42a883..000000000 Binary files a/resources/testdata/golden/sunset_hu4645485093540451131.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu5700214275785775137.jpg b/resources/testdata/golden/sunset_hu5700214275785775137.jpg deleted file mode 100644 index f09ff9e33..000000000 Binary files a/resources/testdata/golden/sunset_hu5700214275785775137.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu5943101889480068836.jpg b/resources/testdata/golden/sunset_hu5943101889480068836.jpg deleted file mode 100644 index 7e35750db..000000000 Binary files a/resources/testdata/golden/sunset_hu5943101889480068836.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu6418511461467579286.jpg b/resources/testdata/golden/sunset_hu6418511461467579286.jpg deleted file mode 100644 index 60207a829..000000000 Binary files a/resources/testdata/golden/sunset_hu6418511461467579286.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu7124641571345460976.jpg b/resources/testdata/golden/sunset_hu7124641571345460976.jpg deleted file mode 100644 index ee246814d..000000000 Binary files a/resources/testdata/golden/sunset_hu7124641571345460976.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu7168213667150853195.jpg b/resources/testdata/golden/sunset_hu7168213667150853195.jpg deleted file mode 100644 index 8e6164e32..000000000 Binary files a/resources/testdata/golden/sunset_hu7168213667150853195.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu8110718388195953309.jpg b/resources/testdata/golden/sunset_hu8110718388195953309.jpg deleted file mode 100644 index 93b914161..000000000 Binary files a/resources/testdata/golden/sunset_hu8110718388195953309.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu8726458014885573310.jpg b/resources/testdata/golden/sunset_hu8726458014885573310.jpg deleted file mode 100644 index e7db706c2..000000000 Binary files a/resources/testdata/golden/sunset_hu8726458014885573310.jpg and /dev/null differ diff --git a/resources/testdata/golden/sunset_hu9995349819947557369.jpg b/resources/testdata/golden/sunset_hu9995349819947557369.jpg deleted file mode 100644 index f7e84e33d..000000000 Binary files a/resources/testdata/golden/sunset_hu9995349819947557369.jpg and /dev/null differ diff --git a/resources/testdata/golden_webp/fuzzy-cirlcle_hu11078464949742740533.webp b/resources/testdata/golden_webp/fuzzy-cirlcle_hu11078464949742740533.webp deleted file mode 100644 index c9d229782..000000000 Binary files a/resources/testdata/golden_webp/fuzzy-cirlcle_hu11078464949742740533.webp and /dev/null differ