jonathanmaron/image-optimizer
Composer 安装命令:
composer create-project jonathanmaron/image-optimizer
包简介
Image optimization and compression tool for the console. This tool optimizes PNG, JPEG and GIF files, using 'gifsicle', 'jpegoptim', 'jpegtran', 'pngcrush' and 'pngout' and can usually reduce the filesize by 10% to 70%.
README 文档
README
Image optimization and compression tool for the console. This tool optimizes PNG, JPEG and GIF files, using gifsicle, jpegoptim, jpegtran, pngcrush and pngout and can usually reduce the filesize by 10% to 70%.
As optimzing images is CPU intensive and it may take several minutes for a larger PNG file, image-optimizer keeps track of which image files it has optimized. Each image file will only be optimize once, unless the --force flag is set.
image-optimizer is intended to be run unattended in a cronjob.
Example Usage
Optimize Images In /path/to/images
image-optimizer --path="/path/to/images"
Optimize Images In /path/to/images, Ignoring History
image-optimizer --path="/path/to/images" --force
Set All Images In /path/to/images As Optimized
image-optimizer --path="/path/to/images" --index-only
Installation
Installation is via composer:
cd ~/install-path
composer create-project jonathanmaron/image-optimizer
It is recommended to include ~/bin in your PATH variable:
PATH=$PATH:~/install-path/image-optimizer/bin
so that image-optimizer is available to the logged in user globally.
Upgrading From v1 and v2
Between v1 and v3, the structure of the history directory was updated. Therefore, please remove your current history directory. A new one, with the new structure, will be created when image-optimizer is executed for the first time:
rm -fr ~/.image_optimizer
Dependencies
image-optimizer depends upon gifsicle, jpegoptim, jpegtran, pngcrush and pngout to perform its work. These tools must be installed, otherwise image-optimizer will return an error.
Download and install pngout at:
http://static.jonof.id.au/dl/kenutils/pngout-20150319-linux-static.tar.gz (or newer)
then unpack, then copy to:
/usr/bin/pngout
Download and install other dependencies:
apt install pngcrush libjpeg-progs jpegoptim gifsicle
jonathanmaron/image-optimizer 适用场景与选型建议
jonathanmaron/image-optimizer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 45 次下载、GitHub Stars 达 5, 最近一次更新时间为 2016 年 04 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「image」 「compression」 「optimization」 「pngcrush」 「image optimizer」 「pngout」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jonathanmaron/image-optimizer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jonathanmaron/image-optimizer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jonathanmaron/image-optimizer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Asset Management for PHP
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
Image optimization widget for Yii2 Framework with auto WebP/AVIF image format generation from PNG/JPG files.
Optimize your email templates' styles via native Laravel templating mechanism.
统计信息
- 总下载量: 45
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2016-04-25