Skip to content

Commit 0176883

Browse files
authored
Create README.md
1 parent 4af1449 commit 0176883

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ In the case of the example above, an image of 400px × 600px will be resize
109109
Crop modes:
110110

111111
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`.
113113
As a result those pieces of code are equivalent:
114114

115115
```php
@@ -120,26 +120,26 @@ $image->save('image2.jpg');
120120

121121
```php
122122
$image = new ImageResize('image.jpg');
123-
$image->crop(200, 200, 2);
123+
$image->crop(200, 200, ImageResize::CROPCENTER);
124124
$image->save('image2.jpg');
125125
```
126126

127127
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.
128128

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.
130130

131131

132132
```php
133133
$image = new ImageResize('image.jpg');
134-
$image->crop(200, 200, 1);
134+
$image->crop(200, 200, ImageResize::CROPTOP);
135135
$image->save('image2.jpg');
136136
```
137137

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.
139139

140140
```php
141141
$image = new ImageResize('image.jpg');
142-
$image->crop(200, 200, 3);
142+
$image->crop(200, 200, ImageResize::CROPBOTTOM);
143143
$image->save('image2.jpg');
144144
```
145145

0 commit comments

Comments
 (0)