resource: Add smart cropping
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 3 Feb 2018 15:47:35 +0000 (16:47 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 5 Feb 2018 12:59:15 +0000 (13:59 +0100)
commit722086b4ed3e77d1aba6724474bec06d08e7de06
tree470bd91123d6de0f7a38ca40ec18a4d4835d9f8c
parent084cf4191b3c1e7590a4223fd9251019ef5d4c21
resource: Add smart cropping

This commit `smart` as a new and default anchor in `Fill`.

So:

```html
{{ $image.Fill "200x200" }}
```

Is, with default configuration, the same as:

```html
{{ $image.Fill "200x200" "smart" }}
```

You can change this default in your `config.toml`:

```toml
[imaging]
[imaging]
resampleFilter = "box"

quality = 68

anchor = "Smart"
```

Fixes #4375
Gopkg.lock
Gopkg.toml
resource/image.go
resource/image_test.go
resource/smartcrop.go [new file with mode: 0644]
resource/testhelpers_test.go