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

Method String

processing/crop_test.go:118–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116}
117
118func (c cropTestCase) String() string {
119 var b bytes.Buffer
120
121 if c.gravity != 0 {
122 fmt.Fprintf(&b, "_gravity_%s", c.gravity.String())
123 }
124
125 if c.cropGravity != 0 {
126 fmt.Fprintf(&b, "_crop_gravity_%s", c.cropGravity.String())
127 }
128
129 if c.cropSize.width > 0 && c.cropSize.height > 0 {
130 fmt.Fprintf(&b, "_crop_%dx%d", c.cropSize.width, c.cropSize.height)
131 }
132
133 if c.xOffset != 0 || c.yOffset != 0 {
134 fmt.Fprintf(&b, "_offset_%f_%f", c.xOffset, c.yOffset)
135 }
136
137 if c.dpr > 0 {
138 fmt.Fprintf(&b, "_dpr_%g", c.dpr)
139 }
140
141 n, _ := strings.CutPrefix(b.String(), "_")
142 return n
143}
144
145func (s *CropTestSuite) TestResizeFill() {
146 widerSize := testSize{100, 26}

Callers 3

StringMethod · 0.45
TestResizeFillMethod · 0.45
TestCropMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected