| 280 | } |
| 281 | |
| 282 | func TestEmbedExtendWithCustomColor(t *testing.T) { |
| 283 | options := Options{Width: 400, Height: 600, Crop: false, Embed: true, Extend: 5, Background: Color{255, 20, 10}} |
| 284 | buf, _ := Read("testdata/test_issue.jpg") |
| 285 | |
| 286 | newImg, err := Resize(buf, options) |
| 287 | if err != nil { |
| 288 | t.Errorf("Resize(imgData, %#v) error: %#v", options, err) |
| 289 | } |
| 290 | |
| 291 | size, _ := Size(newImg) |
| 292 | if size.Height != options.Height || size.Width != options.Width { |
| 293 | t.Fatalf("Invalid image size: %dx%d", size.Width, size.Height) |
| 294 | } |
| 295 | |
| 296 | Write("testdata/test_extend_background_out.jpg", newImg) |
| 297 | } |
| 298 | |
| 299 | func TestGaussianBlur(t *testing.T) { |
| 300 | options := Options{Width: 800, Height: 600, GaussianBlur: GaussianBlur{Sigma: 5}} |