note 97032 added to function.imagepng
| From: | wietse89 at gmail dot com | Date: | Mon, 29 Mar 2010 14:55:41 +0000 |
| Subject: | note 97032 added to function.imagepng | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-167492@lists.php.net to get a copy of this message | ||
When you allow multiple output formats, (jpg/png) but want to use the 1-100 quality scale (like
jpg), you will have to format the number:
<?php
$pngQuality = ($quality - 100) / 11.111111;
$pngQuality = round(abs($pngQuality));
imagepng($resource, $path, $pngQuality);
?>
----
Server IP: 213.249.64.162
Probable Submitter: 80.79.43.174
----
Manual Page -- http://www.php.net/manual/en/function.imagepng.php
Edit -- https://master.php.net/note/edit/97032
Del: integrated -- https://master.php.net/note/delete/97032/integrated
Del: useless -- https://master.php.net/note/delete/97032/useless
Del: bad code -- https://master.php.net/note/delete/97032/bad+code
Del: spam -- https://master.php.net/note/delete/97032/spam
Del: non-english -- https://master.php.net/note/delete/97032/non-english
Del: in docs -- https://master.php.net/note/delete/97032/in+docs
Del: other reasons-- https://master.php.net/note/delete/97032
Reject -- https://master.php.net/note/reject/97032
Search -- https://master.php.net/manage/user-notes.php