| @@ 76-90 (lines=15) @@ | ||
| 73 | * |
|
| 74 | * @return $this |
|
| 75 | */ |
|
| 76 | public function crop(string $cropMethod, int $width, int $height) |
|
| 77 | { |
|
| 78 | if (! $this->validateManipulation($cropMethod, 'crop')) { |
|
| 79 | throw InvalidManipulation::invalidParameter( |
|
| 80 | 'cropmethod', |
|
| 81 | $cropMethod, |
|
| 82 | $this->getValidManipulationOptions('crop') |
|
| 83 | ); |
|
| 84 | } |
|
| 85 | ||
| 86 | $this->width($width); |
|
| 87 | $this->height($height); |
|
| 88 | ||
| 89 | return $this->addManipulation('crop', $cropMethod); |
|
| 90 | } |
|
| 91 | ||
| 92 | /** |
|
| 93 | * @param int $width |
|
| @@ 164-178 (lines=15) @@ | ||
| 161 | * |
|
| 162 | * @return $this |
|
| 163 | */ |
|
| 164 | public function fit(string $fitMethod, int $width, int $height) |
|
| 165 | { |
|
| 166 | if (! $this->validateManipulation($fitMethod, 'fit')) { |
|
| 167 | throw InvalidManipulation::invalidParameter( |
|
| 168 | 'fit', |
|
| 169 | $fitMethod, |
|
| 170 | $this->getValidManipulationOptions('fit') |
|
| 171 | ); |
|
| 172 | } |
|
| 173 | ||
| 174 | $this->width($width); |
|
| 175 | $this->height($height); |
|
| 176 | ||
| 177 | return $this->addManipulation('fit', $fitMethod); |
|
| 178 | } |
|
| 179 | ||
| 180 | /** |
|
| 181 | * @param int $ratio A value between 1 and 8 |
|