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

Method TestResizeToFit

processing/processing_test.go:115–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113}
114
115func (s *ProcessingTestSuite) TestResizeToFit() {
116 testCases := []testCase[sizeTestCase]{
117 {opts: sizeTestCase{width: 50, height: 50}, outSize: testSize{50, 25}},
118 {opts: sizeTestCase{width: 50, height: 20}, outSize: testSize{40, 20}},
119 {opts: sizeTestCase{width: 20, height: 50}, outSize: testSize{20, 10}},
120 {opts: sizeTestCase{width: 300, height: 300}, outSize: testSize{200, 100}},
121 {opts: sizeTestCase{width: 300, height: 50}, outSize: testSize{100, 50}},
122 {opts: sizeTestCase{width: 100, height: 300}, outSize: testSize{100, 50}},
123 {opts: sizeTestCase{width: 0, height: 50}, outSize: testSize{100, 50}},
124 {opts: sizeTestCase{width: 50, height: 0}, outSize: testSize{50, 25}},
125 {opts: sizeTestCase{width: 0, height: 200}, outSize: testSize{200, 100}},
126 {opts: sizeTestCase{width: 300, height: 0}, outSize: testSize{200, 100}},
127 }
128
129 for _, tc := range testCases {
130 s.Run(tc.opts.ShortName(), func() {
131 tc.opts.resizingType = processing.ResizeFit
132
133 s.processImageAndCheck(tc)
134 })
135 }
136}
137
138func (s *ProcessingTestSuite) TestResizeToFitEnlarge() {
139 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