Laravel使用intervention image包上传、剪裁图片

Laravel使用intervention image包上传、剪裁图片,第1张

概述Laravel使用intervention image包上传剪裁图片 下面由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 5

$ PHP artisan vendor:publish --provIDer="Intervention\Image\ImageServiceProvIDerLaravel5"

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 fileImage::make(input::file('photo'))->resize(300, 200)->save('foo.jpg')
总结

以上是内存溢出为你收集整理的Laravel使用intervention image包上传、剪裁图片全部内容,希望文章能够帮你解决Laravel使用intervention image包上传、剪裁图片所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1227909.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-05
下一篇 2022-06-05

发表评论

登录后才能评论

评论列表(0条)

保存