From 26ae4d2fd82c24cac5987cd28b4b11b7199720b8 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 20 Oct 2026 20:10:29 +0200 Subject: [PATCH] issue 1440: the plain-lid test's specks lie where counting them would make a box --- modules/scan/cmd/scan/crop_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/scan/cmd/scan/crop_test.go b/modules/scan/cmd/scan/crop_test.go index b3de57cc..b61a263c 100644 --- a/modules/scan/cmd/scan/crop_test.go +++ b/modules/scan/cmd/scan/crop_test.go @@ -10,13 +10,13 @@ import ( "testing" ) -// lidWhite is a w x h gray image of the lid's white, with a few specks of dust. +// lidWhite is a w x h gray image of the lid's white, with a few specks of dust in one patch. func lidWhite(w, h int, seed int64) *image.Gray { g := image.NewGray(image.Rect(0, 0, w, h)) draw.Draw(g, g.Bounds(), &image.Uniform{color.Gray{255}}, image.Point{}, draw.Src) r := rand.New(rand.NewSource(seed)) for i := 0; i < 40; i++ { - g.SetGray(r.Intn(w), r.Intn(h), color.Gray{120}) + g.SetGray(100+r.Intn(w/4), 100+r.Intn(h/4), color.Gray{120}) // all in one patch, so counting them would make a box } return g }