Files
opencloud/services/thumbnails/pkg/parity/icon_test.go
T
Dominik Schmidt 9b4e173020 test(thumbnails): compare the built-in generator against two real imagors
The same image goes to the built-in generator and to both imagor images,
and status, dimensions, format, frames and alpha are compared. A generator
that answers differently is held to that answer by a recorded override, so
the test fails once the divergence disappears. It runs once per resize
implementation, because make test builds the pure Go path while the images
ship vips.
2026-10-19 14:57:35 +02:00

21 lines
706 B
Go

package parity
// Tika hands over an ICO for a windows executable, and its transparency has to
// survive the resize. Reading one needs a libvips with ImageMagick.
func iconGroup() parityGroup {
return parityGroup{
name: "icon",
cases: []parityCase{
{
title: "an icon resizes into a png that keeps its transparency",
path: "/unsafe/fit-in/32x32/filters:format(png)/",
source: icoSource(64), want: "200 32x32 png alpha",
generatorOverrides: map[string]override{
"imagor-default": {answers: "406", because: "that image has no ICO loader, the magick variant has one"},
"imaging": {answers: "406", because: "the pure Go build reads no ICO"},
},
},
},
}
}