ndar/yii2-imagine
此包已被弃用且不再维护。未建议替代包。
Yii框架的Imagine集成
2.3.0
2020-12-23 17:16 UTC
Requires
- imagine/imagine: ^1.0
- yiisoft/yii2: ~2.0.0
Requires (Dev)
- cweagans/composer-patches: ^1.7
- phpunit/phpunit: 4.8.34
This package is auto-updated.
Last update: 2022-12-29 15:52:37 UTC
README
Imagine扩展用于Yii 2
此扩展增加了最常见的图像功能,同时作为Imagine图像处理库的包装器,用于Yii框架2.0。
有关许可信息,请参阅LICENSE文件。
安装
安装此扩展的首选方式是通过composer。
运行以下命令之一
composer require --prefer-dist yiisoft/yii2-imagine
或
"yiisoft/yii2-imagine": "~2.2.0"
将其添加到composer.json文件的require部分。
基本用法
此扩展是Imagine的包装器,并添加了最常用的图像处理方法。
以下示例展示了如何使用此扩展
use yii\imagine\Image; // frame, rotate and save an image Image::frame('path/to/image.jpg', 5, '666', 0) ->rotate(-8) ->save('path/to/destination/image.jpg', ['jpeg_quality' => 50]);