()
| 89 | } |
| 90 | |
| 91 | func (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 |
no outgoing calls