crocone/yii2-imagine

Yii 框架的 Imagine 集成

安装: 19

依赖者: 0

建议者: 0

安全: 0

星星: 0

关注者: 1

Forks: 94

类型:yii2-extension

2.1.2 2018-11-07 05:39 UTC

This package is auto-updated.

Last update: 2024-09-07 20:11:27 UTC


README

Yii 2 的 Imagine 扩展


此扩展添加了最常见的图像功能,并作为Imagine 图像处理库的包装器,用于Yii 框架 2.0

有关许可信息,请查看LICENSE文件。

Latest Stable Version Total Downloads Build Status

安装

安装此扩展的首选方式是通过composer

运行以下命令之一

php composer.phar require --prefer-dist yiisoft/yii2-imagine

或者将以下内容添加到你的composer.json文件的require部分。

"yiisoft/yii2-imagine": "~2.1.0"

基本用法

此扩展是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]);