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

Method TestResizeToFitEnlarge

processing/processing_test.go:138–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136}
137
138func (s *ProcessingTestSuite) TestResizeToFitEnlarge() {
139 testCases := []testCase[sizeTestCase]{
140 {opts: sizeTestCase{width: 50, height: 50}, outSize: testSize{50, 25}},
141 {opts: sizeTestCase{width: 50, height: 20}, outSize: testSize{40, 20}},
142 {opts: sizeTestCase{width: 20, height: 50}, outSize: testSize{20, 10}},
143 {opts: sizeTestCase{width: 300, height: 300}, outSize: testSize{300, 150}},
144 {opts: sizeTestCase{width: 300, height: 125}, outSize: testSize{250, 125}},
145 {opts: sizeTestCase{width: 250, height: 300}, outSize: testSize{250, 125}},
146 {opts: sizeTestCase{width: 0, height: 50}, outSize: testSize{100, 50}},
147 {opts: sizeTestCase{width: 50, height: 0}, outSize: testSize{50, 25}},
148 {opts: sizeTestCase{width: 0, height: 200}, outSize: testSize{400, 200}},
149 {opts: sizeTestCase{width: 300, height: 0}, outSize: testSize{300, 150}},
150 }
151
152 for _, tc := range testCases {
153 s.Run(tc.opts.ShortName(), func() {
154 tc.opts.resizingType = processing.ResizeFit
155 tc.opts.enlarge = true
156
157 s.processImageAndCheck(tc)
158 })
159 }
160}
161
162func (s *ProcessingTestSuite) TestResizeToFitExtend() {
163 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