()
| 35 | } |
| 36 | |
| 37 | func (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 | |
| 76 | func (r sizeTestCase) String() string { |
| 77 | b := bytes.NewBuffer(nil) |
nothing calls this directly
no test coverage detected