intervention/image intervention/imagecache
http://image.intervention.io/
安装两个包
composer require intervention/image composer require intervention/imagecache
使用
$img = Image::make('public/foo.jpg')->resize(, )->insert('public/watermark.png')->save('public/bar.jpg');
// resizing an uploaded file
Image::make(Input::file('photo'))->resize(300, 200)->save('foo.jpg');
Creating Image from File Upload
// read image from temporary file
$img = Image::make($_FILES['image']['tmp_name']); // resize image
$img->fit(, ); // save image
$img->save('foo/bar.jpg');
laravel router
Route::get('/image/{path}', function($path){
$img = Image::cache(function($img) use($path) {
$img->make(public_path().'/'.$path)->resize(300, 200);
}, 10, true);
return $img->response('jpg');
})->where(['path' => '[0-9a-z\/\._]+']);
intervention/image intervention/imagecache的更多相关文章
- Composer包收录
doctrine/annotations #注解 nesbot/carbon #日期和时间处理 gregwar/captcha symfony/console nikic/fast-route #路由 ...
- 2016年美国数学建模比赛(MCM/ICM) E题环境科学 Are we heading towards a thirsty planet? 人工精准翻译。
第二次参加建模,觉得建模太有趣了,用几天的时间,迅速学习新知识,并解决实际问题. ——————————————————————————————————————————————————————————— ...
- 推荐 Laravel API 项目必须使用的 8 个扩展包
如今在现代网络开发中,比较流行的模式是基于 API 开发,可以通过手机或网站来创建服务. Laravel 是创建基于 API 的项目的最佳框架之一,它为世界各地的大型社区提供了高速开发. Larave ...
- (翻译)2016美国数学建模MCM E题(环境)翻译:我们朝向一个干旱的星球?
PROBLEM E: Are we heading towards a thirsty planet? Will the world run out of clean water? According ...
- PHP之50个开源项目
GitHub上50个最受欢迎的PHP开源项目[2019] 1.Laravel Laravel是一个为Web开发者打造的PHP开发框架. GitHub Stars: 43.5k+ 网址: https:/ ...
- laravel扩展图片处理Intervention Image
github地址:https://github.com/Intervention/image
- vux 使用swiper 垂直滚动文字 报错[Intervention] Ignored...
[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example becaus ...
- [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.
1.滑动时候警告[Intervention] Unable to preventDefault inside passive event listener due to target being tr ...
- vue使用swiper模块滑动时报错:[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example becaus
报错: vue报这个错 [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for ex ...
随机推荐
- ytu 1938:首字母变大写(水题)
首字母变大写 Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 110 Solved: 43[Submit][Status][Web Board] Desc ...
- Java Hour 42 fastjson
fastjson 神一样的存在,然后由于缺乏文档,很多功能完全不知道该怎么用. 42.1 字段的大小写问题 刚开始没想到会因为字段的大小写问题而导致反序列化json 失败. @Override pub ...
- TypeC一个微软开发的超简单.NET依赖注入/IoC容器
控制反转(IoC,Inversion of Control)是由Martin Fowler总结出来的一种设计模式,用来减少代码间的耦合.一般而言,控制反转分为依赖注入(Dependency Injec ...
- 动态链接库(dll)简介(转)
DLL 是 Dynamic Link Library 的缩写,译为“动态链接库”.DLL也是一个被编译过的二进制程序,可以被其他程序调用,但与 exe 不同,DLL不能独立运行,必须由其他程序调用载入 ...
- matlab练习程序(构造简单多边形)
简单多边形是指各边不相交的多边形. 首先计算出所有顶点中心位置. 然后求每个顶点与中心的极角. 再对极角进行排序. 连接排序后的点就行了. 结果如下: matlab代码如下: clear all;cl ...
- 一条语句简单解决“每个Y的最新X”的SQL经典问题
"每个Y的最新X"是一个经典的SQL问题,工作中经常碰到.当然不是"按Y分组求最新的X值"那么简单,要求最新X的那条记录或主键ID.用一条SQL语句可以简单的解 ...
- ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component解决
第一:先确定一下开发流程是否正确 1.写好servlet组件类 2.写好web.xml文件--向服务器介绍组件 3.发布--就是拷贝 注意:要拷贝包结构,不要只拷贝组件类文件 另外,拷贝的是.clas ...
- 01背包 URAL 1073 Square Country
题目传送门 /* 题意:问n最少能是几个数的平方和 01背包:j*j的土地买不买的问题 详细解释:http://www.cnblogs.com/vongang/archive/2011/10/07/2 ...
- 递推DP URAL 1119 Metro
题目传送门 /* 题意:已知起点(1,1),终点(n,m):从一个点水平或垂直走到相邻的点距离+1,还有k个抄近道的对角线+sqrt (2.0): 递推DP:仿照JayYe,处理的很巧妙,学习:) 好 ...
- Matrix Chain Multiplication[HDU1082]
Matrix Chain Multiplication Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (J ...