MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / TestLinearColorspace

Method TestLinearColorspace

processing/colorspace_test.go:178–228  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176}
177
178func (s *ColorspaceTestSuite) TestLinearColorspace() {
179 testCases := []testCase[colorspaceTestCase]{
180 {
181 opts: colorspaceTestCase{
182 name: "16-bpp-linear-png-rgb16",
183 sourceFile: "test-images/png/16-bpp-linear.png",
184 outFormat: imagetype.PNG,
185 },
186 outSize: colorspaceTestOutSize,
187 outInterpretation: vips.InterpretationRGB16,
188 },
189 {
190 opts: colorspaceTestCase{
191 name: "32-bpp-linear-tiff-rgb16",
192 sourceFile: "test-images/tiff/32-bpp-linear.tiff",
193 outFormat: imagetype.PNG,
194 },
195 outSize: colorspaceTestOutSize,
196 outInterpretation: vips.InterpretationRGB16,
197 },
198 {
199 opts: colorspaceTestCase{
200 name: "16-bpp-linear-png-jpeg-srgb",
201 sourceFile: "test-images/png/16-bpp-linear.png",
202 outFormat: imagetype.JPEG,
203 },
204 outSize: colorspaceTestOutSize,
205 outInterpretation: vips.InterpretationSRGB,
206 },
207 {
208 opts: colorspaceTestCase{
209 name: "8-bpp-png-jpeg-srgb",
210 sourceFile: "test-images/png/8-bpp.png",
211 outFormat: imagetype.JPEG,
212 },
213 outSize: colorspaceTestOutSize,
214 outInterpretation: vips.InterpretationSRGB,
215 },
216 }
217
218 for _, tc := range testCases {
219 s.Run(tc.opts.name+"_linear", func() {
220 s.ImageMatcher, _ = testutil.NewLazySuiteObj(s, func() (*testutil.ImageHashCacheMatcher, error) {
221 return testutil.NewImageHashCacheMatcher(s.TestData, testutil.HashTypeDct), nil
222 })
223 s.Config().Processing.PreserveHDR = true
224 s.Config().Processing.UseLinearColorspace = true
225 s.runTestCase(tc)
226 })
227 }
228}
229
230func (s *ColorspaceTestSuite) TestDownscaleHDR() {
231 testCases := []testCase[colorspaceTestCase]{

Callers

nothing calls this directly

Calls 4

runTestCaseMethod · 0.95
NewLazySuiteObjFunction · 0.92
NewImageHashCacheMatcherFunction · 0.92
RunMethod · 0.80

Tested by

no test coverage detected