bingvanmoorsel / easyimage
支持 Laravel 集成的图像处理和操作库
0.1
2017-01-22 16:21 UTC
Requires
- intervention/imagecache: ^2.3
This package is not auto-updated.
Last update: 2024-09-28 19:36:51 UTC
README
这是一个小型的简单包,扩展了 intervention/imagecache。该包的所有荣誉归创作者所有。这是我第一个包,我做这个包是为了帮助我在一些自己的项目中。欢迎评论、分支,甚至更好的:改进它!
它做了什么?
此包使您可以直接从 URL 调用 fit、crop 和 grayscale 选项。
安装
通过 composer 需要此包
composer require bingvanmoorsel/easyimage
然后添加服务提供者
// config/app.php Intervention\Image\ImageServiceProvider::class, Bingvanmoorsel\EasyImage\Providers\EasyImageServiceProvider::class,
它是如何工作的?
首先,您需要设置 Image Intervention,如本页所述:http://image.intervention.io/use/url
此包扩展了配置中的路由以包含 'c_',例如,如果您的配置是
// config/imagecache.php 'route' => 'img',
该包启用了一个 'c_img' 路由,###解释 URL 由 3 部分组成
http://<yourdomain>.com/c_<route>/<command>/<params>/<path-to-image>
###命令示例
// Fit http://<yourdomain>.com/c_img/fit/300-300/images/profiles/peter.jpg // Crop http://<yourdomain>.com/c_img/crop/300-300/images/profiles/peter.jpg // Greyscale http://<yourdomain>.com/c_img/greyscale/-/images/profiles/peter.jpg
许可证
此包是开源软件,根据 MIT 许可证 许可。