承接 ir/graphics 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ir/graphics

Composer 安装命令:

composer require ir/graphics

包简介

Image Manipulation Class. order by phpno.com

README 文档

README

####图片类优势

  • 压缩图片可以减少30%的磁盘空间 节省开支
  • 用户加载速度快 体验增强
  • 比起GD,执行效率要高 坑大并发

Gm/Im/Gd

Gmagick操作图片使用文档
<?php
require './vendor/autoload.php';

//生成验证码
$code = 'r2h4';
$code = mt_rand(1000, 9999);
$obj  = new \Ir\Graphics\Gm();
$obj->setFontSize(20);
$obj->setFontColor('#eee');
// $obj->setFontStyle('../ttf/Amatic-Bold.ttf');
$obj->getCaptcha($code, 45, 20, 1);

//生成缩略图
$obj = new \Ir\Graphics\Gm('./a.png');
echo $obj->getThumbnail(100, 100, 0, true);

// 截取图片
$obj = new \Ir\Graphics\Gm('./a.png');
echo $obj->getCropImage(500, 500, 0, 4);

//添加文字水印
$obj = new \Ir\Graphics\Gm('./a.png');
echo $obj->getStrWater('www.gongchang.com', 0, 4);

//添加图片水印
$obj = new \Ir\Graphics\Gm('./a.png');
echo $obj->getImgWater('./water.png', 0, 4);

//压缩图片
$obj = new \Ir\Graphics\Gm('./a.png');
echo $obj->compress(); //enhanceimage
Imagick操作图片使用文档
<?php
require './vendor/autoload.php';

//生成缩略图
$code = 'r2h4';
$code = mt_rand(1000, 9999);
$obj  = new \Ir\Graphics\Im();
$obj->setFontSize(20);
$obj->setFontColor('#eee');
// $obj->setFontStyle('../ttf/Amatic-Bold.ttf');
$obj->getCaptcha($code, 45, 20, 1);

//生成缩略图
$obj = new \Ir\Graphics\Im('./a.png');
echo $obj->getThumbnail(100, 100, 0, true);

// // 截取图片
$obj = new \Ir\Graphics\Im('./a.png');
echo $obj->getCropImage(500, 500, 0, 4);

// //添加文字水印
$obj = new \Ir\Graphics\Im('./a.png');
echo $obj->getStrWater('www.gongchang.com', 0, 4);

//添加图片水印
$obj = new \Ir\Graphics\Im('./a.png');
echo $obj->getImgWater('./water.png', 0, 4);

// //压缩图片
$obj = new \Ir\Graphics\Im('./a.png');
echo $obj->compress(); //enhanceimage

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-03