|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-04-01 12:44 UTC] 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
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.