I have used imagepng
function in PHP
to resize pictures. In the current code, I have not specified the quality
parameter.
imagepng($im_dest, $destfile);
But now I want to use it and increase or decrease the quality based on user's demand. To do that I need to know what is the default value of quality parameter in this function but unfortunately, I could not find that in the php.net website.
description of imagepng function in the official website of php
Do you know what is the default
value? Does the quality
parameter greatly affects the output size and quality?
One more question: Somewhere else, I resize the uploaded images (to their original sizes) to ensure there is not any malicious script attached to it. Is it a good practice or it is unnecessary?
Thank you very much for being helpful.
While I was reading some of the user contribute notes I found this one and saying that the default quality is set to 6.
from mhorne69 at gmail dot com
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.
I hope that answers your question :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With