#41080 [Csd]: #38794 also applies to imagegif and imagejpeg
| From: | bjori@php.net | Date: | Fri, 25 May 2007 21:25:41 +0000 |
| Subject: | #41080 [Csd]: #38794 also applies to imagegif and imagejpeg | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969376450@lists.php.net to get a copy of this message | ||
ID: 41080
Updated by: bjori@php.net
Reported By: rpeters+php at icomproductions dot ca
Status: Closed
Bug Type: Documentation problem
Operating System: N/A
PHP Version: Irrelevant
Assigned To: bjori
New Comment:
As I said. I fixed imagegif().
After reading the source more carefully NULL *IS* ok when libgd
provides the gdImageGifCtx() function, same applies for imagewbmp() when
compiled against libgd 1.5+.
imagegif() only has 2 arguments afaict, but does however not complain
if passed 4arguments.
imagejpeg() docs are correct, to skip it (but wishing to pass quality)
use null.
Previous Comments:
------------------------------------------------------------------------
[2007-05-25 20:25:40] rpeters+php at icomproductions dot ca
The doc experts are taken from ca.php.net, with modification dates of
the 24th or 25th of May.
imagegif, and imagewbmp both report:
The path to the saved file. If not set or NULL, the raw image stream
will be outputted directly.
imagejpeg reports:
To skip this argument in order to provide the quality parameter, use
NULL.
None of these pages have appropriate warnings over the use of NULL.
I suggest taking inspiration from the imagepng page, which states:
Note: NULL is invalid if the quality and filters arguments are not
used.
Again, I will note that imagegif is listed as having only 2 parameters
while other bug reports indicate it accepts 4. If it does only take 2,
then the documentation should refrain from specifying that filename can
be set as null in any circumstances. (There are no valid combinations of
two parameters where the second is null.)
------------------------------------------------------------------------
[2007-05-25 20:12:06] bjori@php.net
Fixed imagegif(), imagejpeg() was fix long time ago
------------------------------------------------------------------------
[2007-04-13 22:02:27] rpeters+php at icomproductions dot ca
Description:
------------
Documentation for imagegif and imagejpeg both incorrectly convey that
it is acceptable to pass null or an empty string as the second parameter
without specifying additional parameters.
It is also worth noting that imagegif docs state it only takes 2
parameters, while other bug report comments have indicated it takes 4.
Related: bug #38794
Reproduce code:
---------------
imagegif($imageData, '');
Expected result:
----------------
According to the docs, this should be acceptable, causing the image to
be outputted to the client.
Actual result:
--------------
It throws an exception trying to create a file with a null filename.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41080&edit=1