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

Method TestResizeToFitExtend

processing/processing_test.go:162–184  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160}
161
162func (s *ProcessingTestSuite) TestResizeToFitExtend() {
163 testCases := []testCase[sizeTestCase]{
164 {opts: sizeTestCase{width: 50, height: 50}, outSize: testSize{50, 50}},
165 {opts: sizeTestCase{width: 50, height: 20}, outSize: testSize{50, 20}},
166 {opts: sizeTestCase{width: 20, height: 50}, outSize: testSize{20, 50}},
167 {opts: sizeTestCase{width: 300, height: 300}, outSize: testSize{300, 300}},
168 {opts: sizeTestCase{width: 300, height: 125}, outSize: testSize{300, 125}},
169 {opts: sizeTestCase{width: 250, height: 300}, outSize: testSize{250, 300}},
170 {opts: sizeTestCase{width: 0, height: 50}, outSize: testSize{100, 50}},
171 {opts: sizeTestCase{width: 50, height: 0}, outSize: testSize{50, 25}},
172 {opts: sizeTestCase{width: 0, height: 200}, outSize: testSize{200, 200}},
173 {opts: sizeTestCase{width: 300, height: 0}, outSize: testSize{300, 100}},
174 }
175
176 for _, tc := range testCases {
177 s.Run(tc.opts.ShortName(), func() {
178 tc.opts.resizingType = processing.ResizeFit
179 tc.opts.extend = true
180
181 s.processImageAndCheck(tc)
182 })
183 }
184}
185
186func (s *ProcessingTestSuite) TestResizeToFitExtendAR() {
187 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