定制 kingjerod/php-image-tools 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kingjerod/php-image-tools

Composer 安装命令:

composer require kingjerod/php-image-tools

包简介

An image manipulation library utilizing Imagick.

README 文档

README

Build Status Coverage Status Software License

PHP library for image manipulation, uses modifiers to alter images. Simplifies some of the complicatedness of Imagick. Has a factory to help load remote images, and also find/manipulate images in folders.

Installation

This library requires PHP 5.4 and the Imagick PHP plugin to be installed. On some Unix systems this command should work:

sudo apt-get install php5-imagick

Once you have Imagick installed, use composer to install the library:

composer require kingjerod\php-image-tools

##Usage ImageTools has two main classes, the Image class and the Modifier class. The Modifier classes are used to change an image, either through resizing, cropping or adding text. Multiple modifiers can be applied to an image, and the same modifier can be applied to multiple images.

##Examples

###First use the factory to load an image:

$factory = new ImageFactory();
$image = $factory->createFromLocalFile('/images/apple.png');

###Once you have the image you can use different modifiers to change it: #####Scale an image:

$scale = new Scale(200, 300); //width, height
$image->modify($scale);
$image->save('/images/appleBig.png');

#####Change opacity:

$opacity= new Opacity(0.8); //80% opacity (mostly visible)
$image->modify($opacity);
$image->save('/images/appleBig.png');

#####Add a watermark:

$text = new Text(10, 40, 'Arial.tff', '#000', 0.3, 24, 'Copyright XYZ');
$image->modify($text);
$image->save('/images/appleCopyright.png');

#####Merge two images together

$image2 = $factory->createFromLocalFile('/images/orange.png');
$merge = new Merge(10, 20, $image2);
$image->modify($merge);
$image->save('/images/appleAndOrange.png');

#####Do a bunch of cool things

$image2 = $factory->createFromLocalFile('/images/orange.png');
$merge = new Merge(10, 20, $image2);
$image->modify($merge);
$text = new Text(10, 40, 'Arial.tff', '#000', 0.3, 24, 'Copyright XYZ');
$image->modify($text);
$opacity= new Opacity(0.8); //80% opacity (mostly visible)
$image->modify($opacity);
$image->save('/images/appleAndOrangeCrazy.png');

##Custom Modifiers Creating your own modifiers is easy. Simple create your own class, and implement the ModifierInterface. It has one function:

public function modify(Image $image);

kingjerod/php-image-tools 适用场景与选型建议

kingjerod/php-image-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 05 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「image」 「ImageMagick」 「imagick」 「watermark」 「manipulation」 「processing」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 kingjerod/php-image-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 kingjerod/php-image-tools 我们能提供哪些服务?
定制开发 / 二次开发

基于 kingjerod/php-image-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-24