(t *testing.T)
| 180 | } |
| 181 | |
| 182 | func TestRotate(t *testing.T) { |
| 183 | options := Options{Width: 800, Height: 600, Rotate: 270, Crop: true} |
| 184 | buf, _ := Read("testdata/test.jpg") |
| 185 | |
| 186 | newImg, err := Resize(buf, options) |
| 187 | if err != nil { |
| 188 | t.Errorf("Resize(imgData, %#v) error: %#v", options, err) |
| 189 | } |
| 190 | |
| 191 | if DetermineImageType(newImg) != JPEG { |
| 192 | t.Error("Image is not jpeg") |
| 193 | } |
| 194 | |
| 195 | size, _ := Size(newImg) |
| 196 | if size.Width != options.Width || size.Height != options.Height { |
| 197 | t.Errorf("Invalid image size: %dx%d", size.Width, size.Height) |
| 198 | } |
| 199 | |
| 200 | Write("testdata/test_rotate_out.jpg", newImg) |
| 201 | } |
| 202 | |
| 203 | func TestInvalidRotateDegrees(t *testing.T) { |
| 204 | options := Options{Width: 800, Height: 600, Rotate: 111, Crop: true} |
nothing calls this directly
no test coverage detected