Skip to content

Commit 9c59267

Browse files
authored
Update README.md
1 parent ffef981 commit 9c59267

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@ This will scale the image to as close as it can to the passed dimensions, and th
106106

107107
In the case of the example above, an image of 400px × 600px will be resized down to 200px × 300px, and then 50px will be taken off the top and bottom, leaving you with 200px × 200px.
108108

109+
By default the crop function will crop the center of you image, but there are other options available.
110+
Depending on your needs you can also decide to crop the top, the bottom, the left, the right, or between the top and the center of your image.
111+
If for instance you want to crop the top of your image here is an example of how you can do it :
112+
113+
```php
114+
$image = new ImageResize('image.jpg');
115+
$image->crop(200, 200, 1);
116+
$image->save('image2.jpg');
117+
```
118+
109119
There is also a way to define custom crop position.
110120
You can define $x and $y in ```freecrop``` method:
111121

0 commit comments

Comments
 (0)