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

Method URLOptions

processing/crop_test.go:89–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87}
88
89func (c cropTestCase) URLOptions() string {
90 opts := testutil.NewOptionsBuilder()
91
92 args := opts.Add("crop").
93 Set(0, c.cropSize.width).
94 Set(1, c.cropSize.height)
95
96 if c.cropGravity != processing.GravityUnknown {
97 args.Set(2, c.cropGravity)
98
99 if c.xOffset != 0 {
100 args.Set(3, c.xOffset)
101 }
102 if c.yOffset != 0 {
103 args.Set(4, c.yOffset)
104 }
105 }
106
107 if c.gravity != processing.GravityUnknown {
108 opts.Add("gravity").Set(0, c.gravity)
109 }
110
111 if c.dpr != 0 {
112 opts.Add("dpr").Set(0, c.dpr)
113 }
114
115 return opts.String()
116}
117
118func (c cropTestCase) String() string {
119 var b bytes.Buffer

Callers

nothing calls this directly

Calls 4

AddMethod · 0.95
StringMethod · 0.95
NewOptionsBuilderFunction · 0.92
SetMethod · 0.45

Tested by

no test coverage detected