coresphereweb / loremimage
PHP 的随机图片系统
1.1.2
2017-11-14 06:27 UTC
Requires
- php: >=5.2.2
This package is not auto-updated.
Last update: 2024-09-28 20:19:54 UTC
README
它需要 PHP 5.2+ 并且采用新 BSD 许可证。您可以从我们的 GitHub 仓库 获取最新版本,或者通过 Composer 安装。
composer require coresphereweb/loremimage
使用方法
渲染
$lorem = new \LoremImage\LoremImage(); $lorem->setPathUrl('/loremimage/'); $lorem->setPathImages(PATH . 'img/loremimage/'); $lorem->render();
通过 _GET 条件
- b[/b] w - 调整宽度
- (int) h - 调整高度
- (string) category(s) (setPathImages() 中的文件夹)
- (int) picture
- (string) effect
- (int) qtd
- (bool) hierarchy - 默认为激活状态,当为 false 时,系统将停止从父类别中读取子类别。
- (string) resize - 裁剪(默认),填充或比例
效果
- pixelate*
- smooth*
- noise*
- negative
- emboss*
- edge*
- contrast
- colorize
- grayscale
- brightness
- blur*
- blur2*
- sharpen
- 这些效果响应于 _GET['qtd'],递归时以输入的数字执行相同的过程。请注意,数字越高,消耗越大,速度越慢。
路由(可选)
- 宽度和高度:/loremimage/r/600/400
- 类别:/loremimage/cars
- 宽度和高度以及类别:/loremimage/600/400/cars
- 宽度和高度、类别以及按升序选择图片:/loremimage/600/400/cars/1
- 重要:.htaccess 是路由工作所必需的
(c) Coresphere Tecnologia, 2016 (http://coresphe.re)