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