intervention/image intervention/imagecache
2015-12-01 15:22
363 查看
安装两个包
使用
laravel router
composer require intervention/image composer require intervention/imagecache
使用
$img = Image::make('public/foo.jpg')->resize(320, 240)->insert('public/watermark.png')[code]->save('public/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\/\._]+']);
相关文章推荐
- 学习安卓网址
- 让多个Fragment 切换时不重新实例化
- 向日葵和您把话一谈!
- 坚持就是胜利—兄弟连IT教育
- 最近一段时间遇到的费了时间的问题
- php Apache配置伪静态的介绍
- 对于Synchronized、ReentrantLock、Atomic、CAS在并发下面的性能比较测试
- xmemcached下载地址
- shell之gollum安装+注释
- 规则引擎Visual Rules Solution开发基础教程
- xmemcached下载地址
- haproxy 配置心跳检查
- 最新手机号码正则表达式
- Centos7 ifconfig Command not found
- hadoop学习007
- html鼠标悬停显示title html内容
- poj3241 曼哈顿最小距离生成树第k大的边
- java学习笔记-设计模式1(简介)
- ORACLE lag()与lead() 函数
- VIM cscope nmap不能工作