bavix / glow-kit
此包已被废弃且不再维护。未建议替代包。
用于处理图像的集合
2.0.0
2020-08-31 15:16 UTC
Requires
- php: ^7.3
- intervention/image: ^2.5
Requires (Dev)
- infection/infection: ^0.16|^0.17
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2023-11-29 03:14:49 UTC
README
glow-kit - 用于处理图像的集合。
- 供应商: bavix
- 包: glow-kit
- 版本:
- PHP 版本: 7.3+
- Composer:
composer require bavix/glow-kit
开始使用
该库实现了处理图像的简单算法。
- 缩小
- 包含
- 覆盖
- 适合
适合图像
use Intervention\Image\ImageManagerStatic; use Bavix\Glow\Adapters\Fit; $adapter = new Fit(ImageManagerStatic::getManager()); $image = ImageManagerStatic::make(__DIR__ . '/image.jpg'); $result = $adapter->apply($image, [ 'width' => '300', 'height' => '300', ]); $result->save(__DIR__ . '/output.jpg');
包含图像
use Intervention\Image\ImageManagerStatic; use Bavix\Glow\Adapters\Contain; $adapter = new Contain(ImageManagerStatic::getManager()); $image = ImageManagerStatic::make(__DIR__ . '/image.jpg'); $result = $adapter->apply($image, [ 'width' => '300', 'height' => '300', ]); $result->save(__DIR__ . '/output.jpg');
覆盖图像
use Intervention\Image\ImageManagerStatic; use Bavix\Glow\Adapters\Cover; $adapter = new Cover(ImageManagerStatic::getManager()); $image = ImageManagerStatic::make(__DIR__ . '/image.jpg'); $result = $adapter->apply($image, [ 'width' => '300', 'height' => '300', ]); $result->save(__DIR__ . '/output.jpg');
支持