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的更多相关文章

  1. Composer包收录

    doctrine/annotations #注解 nesbot/carbon #日期和时间处理 gregwar/captcha symfony/console nikic/fast-route #路由 ...

  2. 2016年美国数学建模比赛(MCM/ICM) E题环境科学 Are we heading towards a thirsty planet? 人工精准翻译。

    第二次参加建模,觉得建模太有趣了,用几天的时间,迅速学习新知识,并解决实际问题. ——————————————————————————————————————————————————————————— ...

  3. 推荐 Laravel API 项目必须使用的 8 个扩展包

    如今在现代网络开发中,比较流行的模式是基于 API 开发,可以通过手机或网站来创建服务. Laravel 是创建基于 API 的项目的最佳框架之一,它为世界各地的大型社区提供了高速开发. Larave ...

  4. (翻译)2016美国数学建模MCM E题(环境)翻译:我们朝向一个干旱的星球?

    PROBLEM E: Are we heading towards a thirsty planet? Will the world run out of clean water? According ...

  5. PHP之50个开源项目

    GitHub上50个最受欢迎的PHP开源项目[2019] 1.Laravel Laravel是一个为Web开发者打造的PHP开发框架. GitHub Stars: 43.5k+ 网址: https:/ ...

  6. laravel扩展图片处理Intervention Image

    github地址:https://github.com/Intervention/image

  7. vux 使用swiper 垂直滚动文字 报错[Intervention] Ignored...

    [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example becaus ...

  8. [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 ...

  9. 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 ...

随机推荐

  1. 练习prototype的实现

    这个BLOG不错,我练习了一下代码. 感觉他是个高手. ======================== http://www.w3cfuns.com/notes/17398/35b250e9b392 ...

  2. 计数排序算法——时间复杂度O(n+k)

    计数排序 计数排序是一个非基于比较的排序算法,该算法于1954年由 Harold H. Seward 提出.它的优势在于在对一定范围内的整数排序时,它的复杂度为Ο(n+k)(其中k是整数的范围),快于 ...

  3. ServletContext中常用方法(getRsource和getResourceAsStream)

    转自:http://blog.csdn.net/yakson/article/details/9203267 一..获取Tomcat的Context的初始化参数. 1.获取Tomcat的server. ...

  4. 获取表信息(MSSQL)

    涉及到的系统表汇总 sys.databases sys.objects sys.indexes sys.tables sys.columns sys.data_spaces sys.partition ...

  5. listview分页

    listview.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStat ...

  6. Android之SurfaceView学习(一)

    对应的中文翻译SurfaceView是视图(View)的继承类,这个视图里内嵌了一个专门用于绘制的Surface.你可以控制这个Surface的格式和尺寸.Surfaceview控制这个Surface ...

  7. MySQL用户与权限管理

    执行mysql select 查询报错: SELECT command denied to user 'root'@'localhost' for table "xxx" 问题原因 ...

  8. SU supef命令学习

  9. 【BZOJ】1507: [NOI2003]Editor(Splay)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1507 当练splay模板了,发现wjmzbmr的splay写得异常简介,学习了.orzzzzzzzz ...

  10. 使用Powershell取出属于某些指定组的用户并导出为csv

    知识这东西就像雪球,越滚越大,今天看到了这篇自己1年多前写的博文,简直弱爆了.于是更新一下程序: 2016-6-15更新,短短几行代码,就拿到了组和组成员,其中还用到了递归,以处理组成员是组的情况: ...