clarence/thumbnail
Composer 安装命令:
composer require clarence/thumbnail
包简介
A library for making thumbnails, especially for composed images' thumbnail
README 文档
README
A library for make multi images' thumbnail in PHP
用PHP写的一个生成多张图片的组合缩略图
Install 安装
Except downloading the source code from github, it is recommended to install via composer:
除了从 github 上下载源码外,推荐使用composer安装:
composer require clarence/thumbnail
Examples 示例
Composite the following 4 images into a thumbnail:
将以下四张图组合起来生成一张缩略图:
Let's see the result firstly:
先看效果:
Then, the example codes:
再看代码:
// file: test/example.php $thumbnail = \Clarence\Thumbnail\Thumbnail::createFromImages($srcImages, 240, 320); $thumbnail->writeImage($outputDir."/example.jpg");
Really pretty simple codes:
十分简单的代码~
Thumbnail::createFromImages is ussed to create the composited thumbnail. The first parameter is an array of original images' pathes; The second parameter is the thumbnail's width; The third parameter is the thumbnail's height; Then the image created is an instance of Imagick - so writeImage can be used to save it to a file.
Thumbnail::createFromImages 就是用于生成缩略图的关键函数,其第一个参数是原始图片的文件路径列表,第二个参数是生成的缩略图的宽度,第三个参数是生成的缩略图的高度;生成的图片是一个Imagick对象,然后可以使用writeImage将其保存到文件。
Other thumbnail types 其他缩略图类型
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-25