ID: 44591
Updated by: [EMAIL PROTECTED]
Reported By: woeterman at gmail dot com
Status: Open
Bug Type: GD related
Operating System: imagegif's filename parameter
PHP Version: 5.2CVS-2008-04-01 (CVS)
New Comment:
Index: ext/gd/gd.c
===================================================================
RCS file: /repository/php-src/ext/gd/gd.c,v
retrieving revision 1.312.2.20.2.32.2.3
diff -u -p -r1.312.2.20.2.32.2.3 gd.c
--- ext/gd/gd.c 10 Mar 2008 22:12:34 -0000 1.312.2.20.2.32.2.3
+++ ext/gd/gd.c 1 Apr 2008 23:45:00 -0000
@@ -2812,7 +2812,7 @@ static void _php_image_output(INTERNAL_F
}
}
- if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
+ if (argc >= 2 && Z_STRLEN_PP(file)) {
PHP_GD_CHECK_OPEN_BASEDIR(fn, "Invalid filename");
fp = VCWD_FOPEN(fn, "wb");
I think that this should solve this problem.
Previous Comments:
------------------------------------------------------------------------
[2008-04-01 12:44:13] woeterman at gmail dot com
Description:
------------
The documentation says:
'The path to save the file to. If not set or NULL, the raw image stream
will be outputted directly.'
But when using null, the image is not saved to a file, but not
displayed on the screen either.
Reproduce code:
---------------
<?php
// This will save the image to 'test.gif'
imagegif($resource, 'test.gif');
// This should display the image on the screen, but doesnt save nor
display
imagegif($resource, null);
// This displays the image on the screen.
imagegif($resource);
?>
Expected result:
----------------
First line to save the file to 'test.jpg', which works.
The last 2 lines to display the image on the screen, but only the last
one does.
Actual result:
--------------
First line saves the file, middle line seems to do nothing, and the
last line displays the image on the screen.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44591&edit=1