Imagick resizeImage():当不指定Imagick中最大高度时使用什么参数?
我正在使用Imagick 3.7.0根据ImageMagick 7.0.10-23 Q16 x86_64
在以前版本的Imagick中,我可以调整指定宽度的图像大小,但使用此命令的高度无限,其中$ width是特定的尺寸,但无效旨在表示高度的无限含义:
justizeImage($ width,null,Imagick :: Filter_lanczos,1);
使用我加载的新Imagick使用用于使用PHP 8.1在我的服务器上:
imagick :: resizeImage():将null传递到int类型的参数#2($行)被弃用
在这种情况下向第二个参数提供的适当参数是什么?
非常感谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您通过
$ bestfit = true
,则图像保留了比例。$ width
和$ height
被视为Max-With和Max-Height。因此,如果您通过一个非常大的$ height
,则图像大小将受到限制为$ width
。例如:请参阅: http://www.phpimagick.com/imagick/imagick/resizeimage?width = 200&height = 500& amp;
if you pass
$bestFit=true
, the image keeps the scale.$width
and$height
are treated as max-with and max-height. So if you pass a very large$height
, the image-size will be limited be the provided$width
. For example:See: http://www.phpimagick.com/Imagick/resizeImage?width=200&height=500&blur=1&filter_type=Lanczos&crop=Disabled&best_fit=Enabled&image_path=Lorikeet