| @@ 82-93 (lines=12) @@ | ||
| 79 | * |
|
| 80 | * @throws InvalidManipulation |
|
| 81 | */ |
|
| 82 | public function orientation(string $orientation) |
|
| 83 | { |
|
| 84 | if (! $this->validateManipulation($orientation, 'orientation')) { |
|
| 85 | throw InvalidManipulation::invalidParameter( |
|
| 86 | 'orientation', |
|
| 87 | $orientation, |
|
| 88 | $this->getValidManipulationOptions('orientation') |
|
| 89 | ); |
|
| 90 | } |
|
| 91 | ||
| 92 | return $this->addManipulation('orientation', $orientation); |
|
| 93 | } |
|
| 94 | ||
| 95 | /** |
|
| 96 | * @param string $orientation |
|
| @@ 102-113 (lines=12) @@ | ||
| 99 | * |
|
| 100 | * @throws InvalidManipulation |
|
| 101 | */ |
|
| 102 | public function flip(string $orientation) |
|
| 103 | { |
|
| 104 | if (! $this->validateManipulation($orientation, 'flip')) { |
|
| 105 | throw InvalidManipulation::invalidParameter( |
|
| 106 | 'flip', |
|
| 107 | $orientation, |
|
| 108 | $this->getValidManipulationOptions('flip') |
|
| 109 | ); |
|
| 110 | } |
|
| 111 | ||
| 112 | return $this->addManipulation('flip', $orientation); |
|
| 113 | } |
|
| 114 | ||
| 115 | /** |
|
| 116 | * @param string $cropMethod |
|
| @@ 423-434 (lines=12) @@ | ||
| 420 | * |
|
| 421 | * @throws InvalidManipulation |
|
| 422 | */ |
|
| 423 | public function format(string $format) |
|
| 424 | { |
|
| 425 | if (! $this->validateManipulation($format, 'format')) { |
|
| 426 | throw InvalidManipulation::invalidParameter( |
|
| 427 | 'format', |
|
| 428 | $format, |
|
| 429 | $this->getValidManipulationOptions('format') |
|
| 430 | ); |
|
| 431 | } |
|
| 432 | ||
| 433 | return $this->addManipulation('format', $format); |
|
| 434 | } |
|
| 435 | ||
| 436 | /** |
|
| 437 | * @param string $filterName |
|
| @@ 443-454 (lines=12) @@ | ||
| 440 | * |
|
| 441 | * @throws InvalidManipulation |
|
| 442 | */ |
|
| 443 | protected function filter(string $filterName) |
|
| 444 | { |
|
| 445 | if (! $this->validateManipulation($filterName, 'filter')) { |
|
| 446 | throw InvalidManipulation::invalidParameter( |
|
| 447 | 'filter', |
|
| 448 | $filterName, |
|
| 449 | $this->getValidManipulationOptions('filter') |
|
| 450 | ); |
|
| 451 | } |
|
| 452 | ||
| 453 | return $this->addManipulation('filter', $filterName); |
|
| 454 | } |
|
| 455 | ||
| 456 | /** |
|
| 457 | * @param string $filePath |
|
| @@ 507-518 (lines=12) @@ | ||
| 504 | * |
|
| 505 | * @throws InvalidManipulation |
|
| 506 | */ |
|
| 507 | public function watermarkFit(string $fitMethod) |
|
| 508 | { |
|
| 509 | if (! $this->validateManipulation($fitMethod, 'fit')) { |
|
| 510 | throw InvalidManipulation::invalidParameter( |
|
| 511 | 'watermarkFit', |
|
| 512 | $fitMethod, |
|
| 513 | $this->getValidManipulationOptions('fit') |
|
| 514 | ); |
|
| 515 | } |
|
| 516 | ||
| 517 | return $this->addManipulation('watermarkFit', $fitMethod); |
|
| 518 | } |
|
| 519 | ||
| 520 | /** |
|
| 521 | * @param int $xPadding How far is the watermark placed from the left and right edges of the image. |
|
| @@ 547-558 (lines=12) @@ | ||
| 544 | * |
|
| 545 | * @throws InvalidManipulation |
|
| 546 | */ |
|
| 547 | public function watermarkPosition(string $position) |
|
| 548 | { |
|
| 549 | if (! $this->validateManipulation($position, 'position')) { |
|
| 550 | throw InvalidManipulation::invalidParameter( |
|
| 551 | 'watermarkPosition', |
|
| 552 | $position, |
|
| 553 | $this->getValidManipulationOptions('position') |
|
| 554 | ); |
|
| 555 | } |
|
| 556 | ||
| 557 | return $this->addManipulation('watermarkPosition', $position); |
|
| 558 | } |
|
| 559 | ||
| 560 | /** |
|
| 561 | * Sets the opacity of the watermark. Only works with the `imagick` driver. |
|