MCPcopy
hub / github.com/willnorris/imageproxy / String

Method String

data.go:91–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89}
90
91func (o Options) String() string {
92 opts := []string{fmt.Sprintf("%v%s%v", o.Width, optSizeDelimiter, o.Height)}
93 if o.Fit {
94 opts = append(opts, optFit)
95 }
96 if o.Rotate != 0 {
97 opts = append(opts, fmt.Sprintf("%s%d", optRotatePrefix, o.Rotate))
98 }
99 if o.FlipVertical {
100 opts = append(opts, optFlipVertical)
101 }
102 if o.FlipHorizontal {
103 opts = append(opts, optFlipHorizontal)
104 }
105 if o.Quality != 0 {
106 opts = append(opts, fmt.Sprintf("%s%d", optQualityPrefix, o.Quality))
107 }
108 if o.Signature != "" {
109 opts = append(opts, fmt.Sprintf("%s%s", optSignaturePrefix, o.Signature))
110 }
111 if o.ScaleUp {
112 opts = append(opts, optScaleUp)
113 }
114 if o.Format != "" {
115 opts = append(opts, o.Format)
116 }
117 if o.CropX != 0 {
118 opts = append(opts, fmt.Sprintf("%s%v", optCropX, o.CropX))
119 }
120 if o.CropY != 0 {
121 opts = append(opts, fmt.Sprintf("%s%v", optCropY, o.CropY))
122 }
123 if o.CropWidth != 0 {
124 opts = append(opts, fmt.Sprintf("%s%v", optCropWidth, o.CropWidth))
125 }
126 if o.CropHeight != 0 {
127 opts = append(opts, fmt.Sprintf("%s%v", optCropHeight, o.CropHeight))
128 }
129 if o.SmartCrop {
130 opts = append(opts, optSmartCrop)
131 }
132 if o.Trim {
133 opts = append(opts, optTrim)
134 }
135 sort.Strings(opts)
136 return strings.Join(opts, ",")
137}
138
139// transform returns whether o includes transformation options. Some fields
140// are not transform related at all (like Signature), and others only apply in

Callers 9

TestProxy_logFunction · 0.45
TestProxy_log_defaultFunction · 0.45
StringMethod · 0.45
updateCacheHeadersMethod · 0.45
validSignatureFunction · 0.45
RoundTripMethod · 0.45
TestOptions_StringFunction · 0.45
TestNewRequestFunction · 0.45

Calls

no outgoing calls

Tested by 5

TestProxy_logFunction · 0.36
TestProxy_log_defaultFunction · 0.36
TestOptions_StringFunction · 0.36
TestNewRequestFunction · 0.36