您的位置:首页 > 其它

intervention/image intervention/imagecache

2015-12-01 15:22 363 查看
安装两个包

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\/\._]+']);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: