transform returns whether o includes transformation options. Some fields are not transform related at all (like Signature), and others only apply in the presence of other fields (like Fit). A non-empty Format value is assumed to involve a transformation.
()
| 141 | // the presence of other fields (like Fit). A non-empty Format value is |
| 142 | // assumed to involve a transformation. |
| 143 | func (o Options) transform() bool { |
| 144 | return o.Width != 0 || o.Height != 0 || o.Rotate != 0 || o.FlipHorizontal || o.FlipVertical || o.Quality != 0 || o.Format != "" || o.CropX != 0 || o.CropY != 0 || o.CropWidth != 0 || o.CropHeight != 0 || o.Trim |
| 145 | } |
| 146 | |
| 147 | // ParseOptions parses str as a list of comma separated transformation options. |
| 148 | // The options can be specified in in order, with duplicate options overwriting |