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

Method URLOptions

processing/watermark_test.go:29–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29func (w watermarkTestCase) URLOptions() string {
30 opts := testutil.NewOptionsBuilder()
31
32 wmArgs := opts.Add("watermark")
33 wmArgs.Set(0, w.opacity).Set(1, w.position)
34
35 if w.xOffset != 0 {
36 wmArgs.Set(2, w.xOffset)
37 }
38 if w.yOffset != 0 {
39 wmArgs.Set(3, w.yOffset)
40 }
41 if w.scale != 0 {
42 wmArgs.Set(4, w.scale)
43 }
44
45 if w.dpr != 0 {
46 opts.Add("dpr").Set(0, w.dpr)
47 }
48
49 if w.format != imagetype.Unknown {
50 opts.Add("format").Set(0, w.format)
51 }
52
53 return opts.String()
54}
55
56func (w watermarkTestCase) String() string {
57 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