定制 lireincore/image 二次开发

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

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

lireincore/image

Composer 安装命令:

composer require lireincore/image

包简介

Image effects, thumbnails and postprocessing

README 文档

README

Latest Stable Version Total Downloads License

About

Supports GD, Imagick and Gmagick.

Also, you can use a special extension lireincore/imgcache that adds the ability to cache thumbs.

Install

Add the "lireincore/image": "^0.3" package to your require section in the composer.json file

or

$ php composer.phar require lireincore/image

Usage

//Use basic effects
use LireinCore\Image\Manipulators\Imagine;
use LireinCore\Image\PostProcessors\OptiPng;

$image = (new Imagine())
    ->open('/path/to/image.jpg')
    ->resize(1000, 500)
    ->grayscale()
    ->blur(2)
    ->text('Hello word', 'Verdana');
    ->save('/path/to/new_image.png', ['format' => 'png', 'png_compression_level' => 7]);

$postProcessor = new OptiPng();
$postProcessor->process('/path/to/new_image.png'); //optimize image

//Also you can add extended effects
use LireinCore\Image\Manipulator;
use LireinCore\Image\Manipulators\Imagine;
use LireinCore\Image\Effects\Overlay;
use LireinCore\Image\Effects\ScaleDown;
use LireinCore\Image\Effects\Fit;
use LireinCore\Image\PostProcessors\JpegOptim;

$image = (new Imagine(Manipulator::DRIVER_GD))
    ->open('/path/to/image.jpg')
    ->apply(new Overlay('/path/to/watermark.png', 70, 'right', 'bottom', '50%', '50%'))
    ->grayscale()
    ->apply(new ScaleDown('50%', '50%', true))
    ->apply(new Fit('center', 'center', '200', '90', '#f00', 20, true))
    ->negative()
    ->save('/path/to/new_image.jpg');

$postProcessor = new JpegOptim();
$postProcessor->process('/path/to/new_image.jpg'); //optimize image

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固