Doc #76179 [Opn]: image2wbmp: missing default value and documentation for threshold argument

From: Date: Tue, 03 Apr 2018 11:55:47 +0000
Subject: Doc #76179 [Opn]: image2wbmp: missing default value and documentation for threshold argument
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-15585@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76179&edit=1 ID: 76179 Updated by: cmb@php.net Reported by: php4fan at gmail dot com Summary: image2wbmp: missing default value and documentation for threshold argument Status: Open Type: Documentation Problem -Package: Documentation problem +Package: GD related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Unfortunately, there is bug #73317, so image2wbmp() still is useless. By the way, do you really want to create WBMP images? Previous Comments: ------------------------------------------------------------------------ [2018-04-03 10:42:36] php4fan at gmail dot com Description: ------------ --- From manual page: http://www.php.net/function.image2wbmp --- > bool image2wbmp ( resource $image [, string $filename [, int $threshold ]] ) > threshold > Threshold value, between 0 and 255 (inclusive). First and most important: what the f*** is the default value if none is given as argument?? The default value for an argument should never be left undocumented. Then, there is no explanation whatsoever of how the threshold works at all (or what it is to start with). My educated guess is that it must be the threshold of brightness above which a pixel will be converted to white and below which it will be converted to black. However, the first non-obvious information that is missing is: what about pixels that have the exact value of the threshold? That is, will it be white if >threshold or if >=threshold? Another non obvious thing is how the threshold works for color images (as opposed to greyscale). Probably the brightness will be computed and then compared to the threshold. But what is the exact function used to compute the brightness from the RGB values? ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76179&edit=1

« previous php.doc.bugs (#15585) next »