下面由laravel教程欄目給大家介紹laravel 使用 intervention image 包上傳、剪裁圖片的方法,希望對需要的朋友有所幫助!
1、通過 composer 安裝 composer intervention/image
2、修改 config/app.php 文件,添加 $providers 和 $aliases
‘InterventionImageImageServiceProvider’
‘Image’ => ‘InterventionImageFacadesImage’
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 5
$ php artisan vendor:publish –provider=”InterventionImageImageServiceProviderLaravel5″
Handling image uploads in Laravel
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')
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載。
THE END