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. [杂]DeadLock, Isolation Level, EntityFramework

    由于没有注意到EF事务的默认隔离级别是Serializable,(据说EF6.0以后默认隔离级别改成了Read_Commit_Snapshot)--这里有误,应该是加了TransactionScope ...

  2. android 自定义弹出框AlertDialog ,很炫的哦

      于是就小小的模仿了下自己写了这个这样的效果,主要代码如下:dlg = new AlertDialog.Builder(context).create();dlg.show();dlg.getWin ...

  3. windows脚本定时执行

    linux下可以直接用cron定时任务,window下可以使用schtasks 命令代替. 第一次在win7 cmd输入: schtasks 如果出现错误:“错误:无法加载列表资源” 的问题原因很简单 ...

  4. Jquery 文档的各种高度和宽度

    $(document).ready(function() { alert($(window).height()); //浏览器时下窗口可视区域高度 alert($(document).height() ...

  5. BZOJ3498 : PA2009 Cakes

    令三元环(i,j,k)中i>j>k,则每条边只需要从大点连向小点 设d[x]表示从x连出的边的条数 从1到n枚举点i,然后枚举所有与i相连的边(i,x)(x<i) 如果$d[x]\l ...

  6. Windows Phone 7之XNA游戏:重力感应

    Windows Phone XNA游戏提供的重力传感器可以利用量测重力的原理判手机移动的方向,允许使用者利用摇动或甩动手机的方式控制游戏的执行,其原理和汽车的安全气囊相同,在侦测到汽车快速减速的时候立 ...

  7. COJ559 回文

    试题描述 给定字符串,求它的回文子序列个数.回文子序列反转字符顺序后仍然与原序列相同.例如字符串aba中,回文子序列为"a", "a", "aa&qu ...

  8. java中的sleep()和wait()的区别

    对于sleep()方法,我们首先要知道该方法是属于Thread类中的.而wait()方法,则是属于Object类中的. sleep()方法导致了程序暂停执行指定的时间,让出cpu该其他线程,但是他的监 ...

  9. winform学习之----将多个控件的click方法绑定到同一click方法中

             public Form3()         {             InitializeComponent();             button1.Click +=new ...

  10. jar MANIFEST.MF 汇总

    : Manifest-Version: 1.0Created-By: Apache Ant 1.5.1Extension-Name: Struts FrameworkSpecification-Tit ...