File manager - Edit - /var/www/payraty/helpdesk/vendor/intervention/image/src/Modifiers/ContainModifier.php
Back
<?php declare(strict_types=1); namespace Intervention\Image\Modifiers; use Intervention\Image\Drivers\SpecializableModifier; use Intervention\Image\Exceptions\RuntimeException; use Intervention\Image\Geometry\Rectangle; use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Interfaces\SizeInterface; class ContainModifier extends SpecializableModifier { public function __construct( public int $width, public int $height, public mixed $background = 'ffffff', public string $position = 'center' ) { } /** * @throws RuntimeException */ public function getCropSize(ImageInterface $image): SizeInterface { return $image->size() ->contain( $this->width, $this->height ) ->alignPivotTo( $this->getResizeSize($image), $this->position ); } public function getResizeSize(ImageInterface $image): SizeInterface { return new Rectangle($this->width, $this->height); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0.05 |
proxy
|
phpinfo
|
Settings