5 use \Intervention\Image\Point;
6 use \Intervention\Image\Size;
18 $width = $this->
argument(0)->type(
'digit')->required()->value();
19 $height = $this->
argument(1)->type(
'digit')->value($width);
20 $constraints = $this->
argument(2)->type(
'closure')->value();
21 $position = $this->
argument(3)->type(
'string')->value(
'center');
24 $cropped = $image->getSize()->fit(
new Size($width, $height), $position);
25 $resized = clone $cropped;
26 $resized = $resized->resize($width, $height, $constraints);
29 $this->
modify($image, 0, 0, $cropped->pivot->x, $cropped->pivot->y, $resized->getWidth(), $resized->getHeight(), $cropped->getWidth(), $cropped->getHeight());