Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 由于某些原因,图像干预会调整图像顶部和底部的大小_Php_Laravel_Intervention - Fatal编程技术网

Php 由于某些原因,图像干预会调整图像顶部和底部的大小

Php 由于某些原因,图像干预会调整图像顶部和底部的大小,php,laravel,intervention,Php,Laravel,Intervention,干预\图像调整大小()方法有问题 我的代码如下: $uploaded_image = Image::make($request->uploaded_image)->fit(600, null, function($constraint){ $constraint->aspectRatio(); $constraint->upsize(); }); 根据文件,这应: 1) 将宽度调整为

干预\图像调整大小()方法有问题

我的代码如下:

$uploaded_image = Image::make($request->uploaded_image)->fit(600, null, function($constraint){
                $constraint->aspectRatio();
                $constraint->upsize();
            });
根据文件,这应: 1) 将宽度调整为600像素 2) 根据纵横比和新宽度定义图像的高度 3) 防止任何升迁

然而,在我的例子中,它是裁剪图像的顶部和底部。我试图处理png图像,如果这是一个告诉


谢谢

这是copy/pasterino的一个主要示例,我以为我在使用resize,而实际上我在使用fit。现在一切都好了,没问题