Skip to content

Commit 851ccb2

Browse files
authored
Merge pull request #735 from ExpressionEngine/feature/7.x/crop-position-center
Enable on-the-fly cropping from image center
2 parents 39cde34 + f2c5b44 commit 851ccb2

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
@@ -222,18 +222,19 @@ Resize the image.
222222

223223
### `:crop`
224224

225-
{news_image:crop width="100" height="100"}
225+
{news_image:crop width="100" height="100" position="center"}
226226

227-
Crop the image.
227+
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.
228228

229229
| Parameter | Values | Default | Description |
230230
| --------- | ------- | ---------- | -------------------------------------- |
231231
| width | `Number` | `*required`| Width to crop to |
232232
| height | `Number` | `*required`| Height to crop to |
233-
| quality | `0`-`100`| `75`| Image quality, % |
234-
| maintain_ratio | `y` / `n` | `y`| Keep image ratio (yes/no) |
235-
| x | `Number` | `0`| Horizontal offset, px |
236-
| y | `Number` | `0`| Vertical offset, px |
233+
| quality | `0`-`100`| `75` | Image quality, % |
234+
| maintain_ratio | `y` / `n` | `y`| Keep image ratio (yes/no) |
235+
| position | `center` | | Crop close to image center |
236+
| x | `Number` | `0` | Horizontal offset, px |
237+
| y | `Number` | `0` | Vertical offset, px |
237238

238239
### `:rotate`
239240

0 commit comments

Comments
 (0)