gtuk/image-optimizer
Composer 安装命令:
composer require gtuk/image-optimizer
包简介
PHP image optimizer for png, jpeg and gif files. It uses mozjpeg, pngquant and gifsicle for the optimization process
关键字:
README 文档
README
PHP image optimizer for png, jpeg and gif files. It uses mozjpeg, pngquant and gifsicle for the optimization process.
This guide assumes you have mozjpeg, pngquant and gifsicle installed.
Installation
You can install this library with composer or include it manually in your project.
Quick start
$optimizer = new Optimizer( array( Optimizer::PNGQUANT_PATH => '/usr/local/bin/pngquant', Optimizer::MOZJPEG_PATH => '/usr/local/bin/cjpeg', Optimizer::GIFSICLE_PATH => '/usr/local/bin/gifsicle' ) );
After this you can run the optimization process. If the optimization failed the method will throw an Exception, otherwise it returns TRUE.
$optimizer->optimize('example.jpg', 'example-optimized.jpg'));
统计信息
- 总下载量: 1.63k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-07-24