【发布时间】:2017-03-28 04:45:35
【问题描述】:
我正在尝试使用 laravel 干预插件。我安装它没有问题,但不能使用它。 我正在尝试制作一个返回调整大小图像的测试函数,但没有成功; 我认为问题可能出在图像路径中,请帮我修复我的代码。
function test($img)
{
/* $img = Image::make('public/image1.jpg');
$img->resize(300, 200);
return $img; */
$image = Image::make('http://localhost/cms/digital-cms/public/image1.jpg')->resize(200, 200, function ($c) {
$c->aspectRatio();
$c->upsize();
});
return $image;
//$h=200; $w=200;
//return Image::make(public_path('public/image1.jpg')->resize($h, $w)->response('jpg'));
}
【问题讨论】:
标签: laravel resize intervention