摘要:下面由Laravel教程栏目给大家介绍Laravel 使用 intervention image 包上传、剪裁图片的方法,希望对需要的朋友有所帮助!1、通过 composer 安装 composer intervention/image2
下面由Laravel教程栏目给大家介绍Laravel 使用 intervention image 包上传、剪裁图片的方法,希望对需要的朋友有所帮助!
1、通过 composer 安装 composer intervention/image
2、修改 config/app.php 文件,添加 $providers
和 $aliases
'Intervention\\Image\\ImageServiceProvider'
'Image' => 'Intervention\\Image\\Facades\\Image'
1、By default Intervention Image uses PHP's GD library extension to process all images. If you want to switch to Imagick, you can pull a configuration file into your application by running on of the following artisan command.
Publish configuration in Laravel 5Handling image uploads in Laravel$ php artisan vendor:publish --provider="Intervention\\Image\\ImageServiceProviderLaravel5"
In a Laravel application it is also possible to pass an uploaded file directly to the make method.
Creating Image from File Upload in Laravel// resizing an uploaded file Image::make(Input::file('photo'))->resize(300, 200)->save('foo.jpg')
相关文章推荐
网站谷歌评分90+意味着什么?2022-09-06
怎样将不安全网站变成安全网站访问?2022-09-26
网站排名下降,可能跟算法更新没关系2022-09-20
网站如何设置高质量的网页标题?2022-09-14
做外贸网站选哪些语言?法语、德语最吃香2022-09-13