Skip to content

Commit ce16636

Browse files
committed
Merge pull request 99designs#18 from virtuman/master
add support for full-fit-in method
2 parents 01fc8bb + b99d364 commit ce16636

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/Thumbor/Url/CommandSet.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,18 @@ public function crop($topLeftX, $topLeftY, $bottomRightX, $bottomRightY)
3535
$this->crop = "{$topLeftX}x{$topLeftY}:{$bottomRightX}x{$bottomRightY}";
3636
}
3737

38+
/**
39+
* Resize the image to fit by smallest side in a box of the specified dimensions.
40+
* Overrides any previous call to `fullFitIn`, `fitIn` or `resize`.
41+
*/
42+
public function fullFitIn($width, $height)
43+
{
44+
$this->resize = "full-fit-in/{$width}x{$height}";
45+
}
46+
3847
/**
3948
* Resize the image to fit in a box of the specified dimensions. Overrides
40-
* any previous call to `fitIn` or `resize`.
49+
* any previous call to `fullFitIn`, `fitIn` or `resize`.
4150
*/
4251
public function fitIn($width, $height)
4352
{
@@ -46,7 +55,7 @@ public function fitIn($width, $height)
4655

4756
/**
4857
* Resize the image to the specified dimensions. Overrides any previous call
49-
* to `fitIn` or `resize`.
58+
* to `fullFitIn`, `fitIn` or `resize`.
5059
*
5160
* Use a value of 0 for proportional resizing. E.g. for a 640 x 480 image,
5261
* `->size(320, 0)` yields a 320 x 240 thumbnail.

0 commit comments

Comments
 (0)