Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added documentation on inset and outbound modes of thumbnail filter Documentation (issue #207) #210

Merged
merged 1 commit into from
Aug 5, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions Resources/doc/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@
### The `thumbnail` filter

The thumbnail filter, as the name implies, performs a thumbnail transformation
on your image. Configuration looks like this:
on your image.

The `mode` can be either `outbound` or `inset`.
Option `inset` does a relative resize, where the height and the width not will exceed the values in the configuration.
Option `outbound` does a relative resize, but the image gets cropped if with and height are not the same.

Given an input image sized 50x40 (width, height), consider the following
annotated configuration examples:

``` yaml
liip_imagine:
filter_sets:
my_thumb:
my_thumb_out:
filters:
thumbnail: { size: [32, 32], mode: outbound } # Transforms 50x40 to 32x32, while cropping the width
my_thumb_in:
filters:
thumbnail: { size: [120, 90], mode: outbound }
thumbnail: { size: [32, 32], mode: inset } # Transforms 50x40 to 32x26, no cropping
```

The `mode` can be either `outbound` or `inset`.

There is also an option `allow_upscale` (default: `false`).
By setting `allow_upscale` to `true`, an image which is smaller than 120x90px in the example above will be expanded to the requested size by interpolation of its content.
Without this option, a smaller image will be left as it. This means you may get images that are smaller than the specified dimensions.
Expand Down