gabrielgil/timthumb
最新稳定版本:2.8.14
Composer 安装命令:
composer require gabrielgil/timthumb
包简介
TimThumb is a simple, flexible, PHP script that resizes images.
README 文档
README
TimThumb is a simple, flexible, PHP script that resizes images.
My intention is to have an updated repo which works with composer on all my known LAMP server configurations because the only timthumb repo on packagist is out of date (2.8.11) which doesn't works for me.
Installing with composer
To use this repo on you composer proyect, simply add an vcs repository pointing to this GitHub repo and require it on your composer.json file:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/GabrielGil/TimThumb"
}
],
"require": {
"gabrielgil/timthumb": "2.*"
}
}
A better way to use TimThumb
I think it's a good way of using timthumb, to store it on a non-public folder (Like the whole composer vendor folder) and then create your own resizer endpoint. If you use it with composer (as this repo is intended to), hide your vendor folder (Just an advice).
How you create your own app structure depends on you, or on your team. If your desired resize endpoint points to a specific file, you can use this code there.
/* Redefine your with own defaults here. * This are just examples, no one is required. */ // Set the time the cache is cleaned (Since the image generation) to one month (2592000/60/60/24=30) define ('FILE_CACHE_MAX_FILE_AGE', 2592000); // Use the default system cache dir so your project's folder stays clean. define ('FILE_CACHE_DIRECTORY', sys_get_temp_dir()); // Quality set to 100% define ('DEFAULT_Q', 100); // Start timthumb. timthumb::start();
After this is set up, you can use all the parameters shown in the official documentation.
Documentation
You can also check the original documentation at binarymoon.uk
gabrielgil/timthumb 适用场景与选型建议
gabrielgil/timthumb 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.1k 次下载、GitHub Stars 达 61, 最近一次更新时间为 2014 年 06 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 gabrielgil/timthumb 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gabrielgil/timthumb 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 6.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 61
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2014-06-10