gpt4 book ai didi

php - PHP 的 imagepng() 函数中质量属性的标准值

转载 作者:可可西里 更新时间:2023-11-01 00:07:04 26 4
gpt4 key购买 nike

根据 PHP 的官方文档,imagepng() 函数具有以下签名:

bool imagepng ( resource $image [, string $filename [, int $quality [, int $filters ]]] )

我现在需要知道的是 $quality 的标准值是多少。我在文档中的任何地方都找不到它。

是否有解释它的来源或任何知道它的人?

最佳答案

来自 php 源代码 (gd.h):

/* 2.0.12: Compression level: 0-9 or -1, where 0 is NO COMPRESSION at all,
* 1 is FASTEST but produces larger files, 9 provides the best
* compression (smallest files) but takes a long time to compress, and
* -1 selects the default compiled into the zlib library.
*/

结论:根据 Zlib 手册 (http://www.zlib.net/manual.html),默认压缩级别设置为 6。

关于php - PHP 的 imagepng() 函数中质量属性的标准值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5378547/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com