asryan / image-man
该软件包最新版本(dev-master)没有提供许可证信息。
帮助处理图像的PHP类
dev-master
2019-02-18 11:04 UTC
Requires
- php: >=7.3.0
This package is auto-updated.
Last update: 2024-09-18 23:26:36 UTC
README
图像处理
入门
安装
在 composer.json 的 require 部分添加
"asryan/image-man": "*"
然后执行 composer update
或者使用以下命令
composer require asryan/image-man
这将把 asryan 目录添加到您的 vendor 目录中
示例
require_once __DIR__ . '/vendor/autoload.php';
use davoasrn\ImageMan;
try {
// Create a new object
$image = new ImageMan();
// Manipulate
$image
->loadFile('penguin.jpg') // load image
//->doRotate(20) // rotate by angle -360 360
->doFlip('both') // flip x horizontally, y vertically, both both
//->doColorize('#ffd700') // tint hex color
->border('#ffd700', 15) // add a 15 pixel yellow border, hex color
//->doBlur('gaussian', 5) // blur default to selective, 5 depth
//->doResize(400, 300) // resize dimensions: 400 width and 300 height
->toFile('new_penguin.jpg'); // output to file with prefix new
} catch(Exception $err) {
// Handle errors
echo $err->getMessage();
}
作者
- Davit Asryan