You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ In the case of the example above, an image of 400px × 600px will be resize
109
109
Crop modes:
110
110
111
111
Few crop mode options are available in order for you to choose how you want to handle the eventual exceeding width or height after resizing down your image.
112
-
The default crop mode used is the 'CROPCENTER' one which value is 2.
112
+
The default crop mode used is the `CROPCENTER`.
113
113
As a result those pieces of code are equivalent:
114
114
115
115
```php
@@ -120,26 +120,26 @@ $image->save('image2.jpg');
120
120
121
121
```php
122
122
$image = new ImageResize('image.jpg');
123
-
$image->crop(200, 200, 2);
123
+
$image->crop(200, 200, ImageResize::CROPCENTER);
124
124
$image->save('image2.jpg');
125
125
```
126
126
127
127
In the case you have an image of 400px × 600px and you want to crop it to 200px × 200px the image will be resized down to 200px × 300px, then you can indicate how you want to handle those 100px exceeding passing the value of the crop mode you want to use.
128
128
129
-
For instance passing the crop mode 'CROPTOP' equal to 1 will result as 100px taken off the bottom leaving you with 200px × 200px.
129
+
For instance passing the crop mode `CROPTOP` will result as 100px taken off the bottom leaving you with 200px × 200px.
130
130
131
131
132
132
```php
133
133
$image = new ImageResize('image.jpg');
134
-
$image->crop(200, 200, 1);
134
+
$image->crop(200, 200, ImageResize::CROPTOP);
135
135
$image->save('image2.jpg');
136
136
```
137
137
138
-
On the contrary passing the crop mode 'CROPBOTTOM' equal to 3 will result as 100px taken off the top leaving you with 200px × 200px.
138
+
On the contrary passing the crop mode `CROPBOTTOM` will result as 100px taken off the top leaving you with 200px × 200px.
0 commit comments