Doc #76179 [Opn->Dup]: image2wbmp: missing default value and documentation for threshold argument
| From: | cmb@php.net | Date: | Sat, 06 Oct 2018 14:31:29 +0000 |
| Subject: | Doc #76179 [Opn->Dup]: image2wbmp: missing default value and documentation for threshold argument | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-16055@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
+Status: Duplicate
Type: Documentation Problem
Package: GD related
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Since the mentioned bug report has been resolved as documentation
problem, this ticket is merely a duplicate.
Previous Comments:
------------------------------------------------------------------------
[2018-04-03 11:55:45] cmb@php.net
Unfortunately, there is bug #73317, so image2wbmp() still is
useless.
By the way, do you really want to create WBMP images?
------------------------------------------------------------------------
[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