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

Method TestResizeToFillExtend

processing/processing_test.go:257–281  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

255}
256
257func (s *ProcessingTestSuite) TestResizeToFillExtend() {
258 testCases := []testCase[sizeTestCase]{
259 {opts: sizeTestCase{width: 50, height: 50}, outSize: testSize{50, 50}},
260 {opts: sizeTestCase{width: 50, height: 20}, outSize: testSize{50, 20}},
261 {opts: sizeTestCase{width: 20, height: 50}, outSize: testSize{20, 50}},
262 {opts: sizeTestCase{width: 300, height: 300}, outSize: testSize{300, 300}},
263 {opts: sizeTestCase{width: 300, height: 125}, outSize: testSize{300, 125}},
264 {opts: sizeTestCase{width: 250, height: 300}, outSize: testSize{250, 300}},
265 {opts: sizeTestCase{width: 300, height: 50}, outSize: testSize{300, 50}},
266 {opts: sizeTestCase{width: 100, height: 300}, outSize: testSize{100, 300}},
267 {opts: sizeTestCase{width: 0, height: 50}, outSize: testSize{100, 50}},
268 {opts: sizeTestCase{width: 50, height: 0}, outSize: testSize{50, 25}},
269 {opts: sizeTestCase{width: 0, height: 200}, outSize: testSize{200, 200}},
270 {opts: sizeTestCase{width: 300, height: 0}, outSize: testSize{300, 100}},
271 }
272
273 for _, tc := range testCases {
274 s.Run(tc.opts.ShortName(), func() {
275 tc.opts.resizingType = processing.ResizeFill
276 tc.opts.extend = true
277
278 s.processImageAndCheck(tc)
279 })
280 }
281}
282
283func (s *ProcessingTestSuite) TestResizeToFillExtendAR() {
284 testCases := []testCase[sizeTestCase]{

Callers

nothing calls this directly

Calls 3

RunMethod · 0.80
ShortNameMethod · 0.80
processImageAndCheckMethod · 0.80

Tested by

no test coverage detected