@@ 78-89 (lines=12) @@ | ||
75 | * |
|
76 | * @throws InvalidManipulation |
|
77 | */ |
|
78 | public function orientation(string $orientation) |
|
79 | { |
|
80 | if (! $this->validateManipulation($orientation, 'orientation')) { |
|
81 | throw InvalidManipulation::invalidParameter( |
|
82 | 'orientation', |
|
83 | $orientation, |
|
84 | $this->getValidManipulationOptions('orientation') |
|
85 | ); |
|
86 | } |
|
87 | ||
88 | return $this->addManipulation('orientation', $orientation); |
|
89 | } |
|
90 | ||
91 | /** |
|
92 | * @param string $cropMethod |
|
@@ 399-410 (lines=12) @@ | ||
396 | * |
|
397 | * @throws InvalidManipulation |
|
398 | */ |
|
399 | public function format(string $format) |
|
400 | { |
|
401 | if (! $this->validateManipulation($format, 'format')) { |
|
402 | throw InvalidManipulation::invalidParameter( |
|
403 | 'format', |
|
404 | $format, |
|
405 | $this->getValidManipulationOptions('format') |
|
406 | ); |
|
407 | } |
|
408 | ||
409 | return $this->addManipulation('format', $format); |
|
410 | } |
|
411 | ||
412 | /** |
|
413 | * @param string $filterName |
|
@@ 419-430 (lines=12) @@ | ||
416 | * |
|
417 | * @throws InvalidManipulation |
|
418 | */ |
|
419 | protected function filter(string $filterName) |
|
420 | { |
|
421 | if (! $this->validateManipulation($filterName, 'filter')) { |
|
422 | throw InvalidManipulation::invalidParameter( |
|
423 | 'filter', |
|
424 | $filterName, |
|
425 | $this->getValidManipulationOptions('filter') |
|
426 | ); |
|
427 | } |
|
428 | ||
429 | return $this->addManipulation('filter', $filterName); |
|
430 | } |
|
431 | ||
432 | /** |
|
433 | * @param string $filePath |
|
@@ 483-494 (lines=12) @@ | ||
480 | * |
|
481 | * @throws InvalidManipulation |
|
482 | */ |
|
483 | public function watermarkFit(string $fitMethod) |
|
484 | { |
|
485 | if (! $this->validateManipulation($fitMethod, 'fit')) { |
|
486 | throw InvalidManipulation::invalidParameter( |
|
487 | 'watermarkFit', |
|
488 | $fitMethod, |
|
489 | $this->getValidManipulationOptions('fit') |
|
490 | ); |
|
491 | } |
|
492 | ||
493 | return $this->addManipulation('watermarkFit', $fitMethod); |
|
494 | } |
|
495 | ||
496 | /** |
|
497 | * @param int $xPadding How far is the watermark placed from the left and right edges of the image. |
|
@@ 523-534 (lines=12) @@ | ||
520 | * |
|
521 | * @throws InvalidManipulation |
|
522 | */ |
|
523 | public function watermarkPosition(string $position) |
|
524 | { |
|
525 | if (! $this->validateManipulation($position, 'position')) { |
|
526 | throw InvalidManipulation::invalidParameter( |
|
527 | 'watermarkPosition', |
|
528 | $position, |
|
529 | $this->getValidManipulationOptions('position') |
|
530 | ); |
|
531 | } |
|
532 | ||
533 | return $this->addManipulation('watermarkPosition', $position); |
|
534 | } |
|
535 | ||
536 | /** |
|
537 | * Sets the opacity of the watermark. Only works with the `imagick` driver. |