| @@ 72-83 (lines=12) @@ | ||
| 69 | * |
|
| 70 | * @throws InvalidManipulation |
|
| 71 | */ |
|
| 72 | public function orientation(string $orientation) |
|
| 73 | { |
|
| 74 | if (! $this->validateManipulation($orientation, 'orientation')) { |
|
| 75 | throw InvalidManipulation::invalidParameter( |
|
| 76 | 'orientation', |
|
| 77 | $orientation, |
|
| 78 | $this->getValidManipulationOptions('orientation') |
|
| 79 | ); |
|
| 80 | } |
|
| 81 | ||
| 82 | return $this->addManipulation('orientation', $orientation); |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * @param string $cropMethod |
|
| @@ 393-404 (lines=12) @@ | ||
| 390 | * |
|
| 391 | * @throws InvalidManipulation |
|
| 392 | */ |
|
| 393 | public function format(string $format) |
|
| 394 | { |
|
| 395 | if (! $this->validateManipulation($format, 'format')) { |
|
| 396 | throw InvalidManipulation::invalidParameter( |
|
| 397 | 'format', |
|
| 398 | $format, |
|
| 399 | $this->getValidManipulationOptions('format') |
|
| 400 | ); |
|
| 401 | } |
|
| 402 | ||
| 403 | return $this->addManipulation('format', $format); |
|
| 404 | } |
|
| 405 | ||
| 406 | /** |
|
| 407 | * @param string $filterName |
|
| @@ 413-424 (lines=12) @@ | ||
| 410 | * |
|
| 411 | * @throws InvalidManipulation |
|
| 412 | */ |
|
| 413 | protected function filter(string $filterName) |
|
| 414 | { |
|
| 415 | if (! $this->validateManipulation($filterName, 'filter')) { |
|
| 416 | throw InvalidManipulation::invalidParameter( |
|
| 417 | 'filter', |
|
| 418 | $filterName, |
|
| 419 | $this->getValidManipulationOptions('filter') |
|
| 420 | ); |
|
| 421 | } |
|
| 422 | ||
| 423 | return $this->addManipulation('filter', $filterName); |
|
| 424 | } |
|
| 425 | ||
| 426 | /** |
|
| 427 | * @param string $filePath |
|
| @@ 477-488 (lines=12) @@ | ||
| 474 | * |
|
| 475 | * @throws InvalidManipulation |
|
| 476 | */ |
|
| 477 | public function watermarkFit(string $fitMethod) |
|
| 478 | { |
|
| 479 | if (! $this->validateManipulation($fitMethod, 'fit')) { |
|
| 480 | throw InvalidManipulation::invalidParameter( |
|
| 481 | 'watermarkFit', |
|
| 482 | $fitMethod, |
|
| 483 | $this->getValidManipulationOptions('fit') |
|
| 484 | ); |
|
| 485 | } |
|
| 486 | ||
| 487 | return $this->addManipulation('watermarkFit', $fitMethod); |
|
| 488 | } |
|
| 489 | ||
| 490 | /** |
|
| 491 | * @param int $xPadding How far is the watermark placed from the top and bottom edges of the image. |
|
| @@ 517-528 (lines=12) @@ | ||
| 514 | * |
|
| 515 | * @throws InvalidManipulation |
|
| 516 | */ |
|
| 517 | public function watermarkPosition(string $position) |
|
| 518 | { |
|
| 519 | if (! $this->validateManipulation($position, 'position')) { |
|
| 520 | throw InvalidManipulation::invalidParameter( |
|
| 521 | 'watermarkPosition', |
|
| 522 | $position, |
|
| 523 | $this->getValidManipulationOptions('position') |
|
| 524 | ); |
|
| 525 | } |
|
| 526 | ||
| 527 | return $this->addManipulation('watermarkPosition', $position); |
|
| 528 | } |
|
| 529 | ||
| 530 | /** |
|
| 531 | * Sets the opacity of the watermark. Only works with the `imagick` driver. |
|