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

Method URLOptions

processing/processing_test.go:37–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35}
36
37func (r sizeTestCase) URLOptions() string {
38 opts := testutil.NewOptionsBuilder()
39
40 if r.limit > 0 {
41 opts.Add("max_result_dimension").Set(0, r.limit)
42 }
43
44 opts.Add("resize").
45 Set(0, r.resizingType).
46 Set(1, r.width).
47 Set(2, r.height)
48
49 if r.enlarge {
50 opts.Add("enlarge").Set(0, 1)
51 }
52
53 if r.extend {
54 opts.Add("extend").Set(0, 1)
55 }
56
57 if r.extendAR {
58 opts.Add("extend_aspect_ratio").Set(0, 1)
59 }
60
61 if r.rotate != 0 {
62 opts.Add("rotate").Set(0, r.rotate)
63 }
64
65 if r.paddingTop > 0 || r.paddingRight > 0 || r.paddingBottom > 0 || r.paddingLeft > 0 {
66 opts.Add("padding").
67 Set(0, r.paddingTop).
68 Set(1, r.paddingRight).
69 Set(2, r.paddingBottom).
70 Set(3, r.paddingLeft)
71 }
72
73 return opts.String()
74}
75
76func (r sizeTestCase) String() string {
77 b := bytes.NewBuffer(nil)

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