Standard value for quality attribute in PHP's imagepng() function
According to PHP's official documentation the imagepng() function has the follow开发者_运维百科ing signature:
bool imagepng ( resource $image [, string $filename [, int $quality [, int $filters ]]] )
What I need to know now is what the standard value of $quality is. I cannot find it anywhere in the documentation.
Is there some source that explains it or anyone who knows about it?
from php source (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.
*/
Conclusion: Based on the Zlib manual (http://www.zlib.net/manual.html) the default compression level is set to 6.
from: http://us2.php.net/manual/en/function.imagepng.php
Compression level: from 0 (no compression) to 9.
default value is 0
In php's source code quality parameter was defaulted to 0. But i havent idea for which value is optimal for image processing.
static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) { zval *imgind; char *file = NULL; long quality = 0, type = 0;
精彩评论