http://image.intervention.io/

安装两个包

  1. composer require intervention/image
  2.  
  3. composer require intervention/imagecache

使用

  1. $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

  1. // read image from temporary file
  2. $img = Image::make($_FILES['image']['tmp_name']);
  3.  
  4. // resize image
  5. $img->fit(, );
  6.  
  7. // save image
  8. $img->save('foo/bar.jpg');

laravel router

  1. 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. IOS项目自动构建

    # Sets the target folders and the final framework product. # 如果工程名称和Framework的Target名称不一样的话,要自定义FMKN ...

  2. Ninja - chromium核心构建工具

    转自:http://guiquanz.me/2014/07/28/a_intro_to_Ninja/ Ninja - chromium核心构建工具Jul 28, 2014 [在线编辑] 缘由 经过上次 ...

  3. android:layout_weight属性详解(转)

    在android开发中LinearLayout很常用,LinearLayout的内控件的android:layout_weight在某些场景显得非常重要,比如我们需要按比例显示.android并没用提 ...

  4. Spotlight on MySQL监控MySQL服务器

    第一步: 下载并安装mysql-connector-3.5x Spotlight on MySQL 连接mysql必须使用mysql-connector-3.5x,5.3.2版本我试了下不行,有兴趣可 ...

  5. BZOJ3735 : [Pa2013]Konduktorzy

    二分一个最大的位置$x$,计算$t=\sum_{i=1}^k\lfloor\frac{x}{a_i}\rfloor$. 如果$t\leq n$,那么说明就算全部检票员都走到了这里,也不够$n$个指令, ...

  6. BZOJ3821 : 玄学

    对操作建立线段树,每个节点维护一个有序的操作表,表示用$[l,r]$的操作在每段区间上的作用效果. 对于一个线段树节点,合并左右儿子信息只在该区间刚刚被填满时进行,利用归并排序,时间复杂度为$O(n\ ...

  7. BZOJ2690 : 字符串游戏

    离线算法: 先将所有涉及到的串建成字典树,然后用线段树维护dfs序,时间复杂度$O(m\log L)$. 在线算法: 用替罪羊树动态维护Trie树的dfs序即可,时间复杂度$O(L\log L)$. ...

  8. Wikioi 1020 孪生蜘蛛 Label:Floyd最短路

    题目描述 Description 在G城保卫战中,超级孪生蜘蛛Phantom001和Phantom002作为第三层防卫被派往守护内城南端一带极为隐秘的通道. 根据防护中心的消息,敌方已经有一只特种飞蛾 ...

  9. [Cocos2d-x For WP8]Particle粒子系统

    在游戏中,经常要实现一些真实的效果,这些效果(如,火焰,雪花等)都是由大量微粒组合而形成的.为了在游戏中实现这种效果,我们必须引进粒子系统,粒子系统中需要包括四个部分:粒子对象,运动规律,随机性,粒子 ...

  10. COJ500 杨老师的路径规划(MST) (我是认真的)

    用LCT来维护生成树,动态加边(s,t,w)时,新建节点x,权值为边权w. 1.若s与t不连通,则连接s-x,x-t,答案+w 2.若s与t连通,找出s-t路径上的最大权w2,若w<w2,删除w ...