| @@ 124-138 (lines=15) @@ | ||
| 121 | * |
|
| 122 | * @throws InvalidManipulation |
|
| 123 | */ |
|
| 124 | public function crop(string $cropMethod, int $width, int $height) |
|
| 125 | { |
|
| 126 | if (! $this->validateManipulation($cropMethod, 'crop')) { |
|
| 127 | throw InvalidManipulation::invalidParameter( |
|
| 128 | 'cropmethod', |
|
| 129 | $cropMethod, |
|
| 130 | $this->getValidManipulationOptions('crop') |
|
| 131 | ); |
|
| 132 | } |
|
| 133 | ||
| 134 | $this->width($width); |
|
| 135 | $this->height($height); |
|
| 136 | ||
| 137 | return $this->addManipulation('crop', $cropMethod); |
|
| 138 | } |
|
| 139 | ||
| 140 | /** |
|
| 141 | * @param int $width |
|
| @@ 220-234 (lines=15) @@ | ||
| 217 | * |
|
| 218 | * @throws InvalidManipulation |
|
| 219 | */ |
|
| 220 | public function fit(string $fitMethod, int $width, int $height) |
|
| 221 | { |
|
| 222 | if (! $this->validateManipulation($fitMethod, 'fit')) { |
|
| 223 | throw InvalidManipulation::invalidParameter( |
|
| 224 | 'fit', |
|
| 225 | $fitMethod, |
|
| 226 | $this->getValidManipulationOptions('fit') |
|
| 227 | ); |
|
| 228 | } |
|
| 229 | ||
| 230 | $this->width($width); |
|
| 231 | $this->height($height); |
|
| 232 | ||
| 233 | return $this->addManipulation('fit', $fitMethod); |
|
| 234 | } |
|
| 235 | ||
| 236 | /** |
|
| 237 | * @param int $ratio A value between 1 and 8 |
|