Skip to content

Commit f2c5b44

Browse files
committed
Enable on-the-fly cropping from image center
1 parent 722b7a9 commit f2c5b44

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/fieldtypes/file.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,19 @@ Resize the image.
216216

217217
### `:crop`
218218

219-
{news_image:crop width="100" height="100"}
219+
{news_image:crop width="100" height="100" position="center"}
220220

221-
Crop the image.
221+
Crop the image. By default, cropping uses top left corner of image as starting position. You can specify `x` and `y` offset, if needed, or `position="center"` parameter to make crop happen close to image center.
222222

223223
| Parameter | Values | Default | Description |
224224
| --------- | ------- | ---------- | -------------------------------------- |
225225
| width | `Number` | `*required`| Width to crop to |
226226
| height | `Number` | `*required`| Height to crop to |
227-
| quality | `0`-`100`| `75`| Image quality, % |
228-
| maintain_ratio | `y` / `n` | `y`| Keep image ratio (yes/no) |
229-
| x | `Number` | `0`| Horizontal offset, px |
230-
| y | `Number` | `0`| Vertical offset, px |
227+
| quality | `0`-`100`| `75` | Image quality, % |
228+
| maintain_ratio | `y` / `n` | `y`| Keep image ratio (yes/no) |
229+
| position | `center` | | Crop close to image center |
230+
| x | `Number` | `0` | Horizontal offset, px |
231+
| y | `Number` | `0` | Vertical offset, px |
231232

232233
### `:rotate`
233234

0 commit comments

Comments
 (0)