Req #54859 [Opn->Csd]: GD: image* support for PHP streams
| From: | dziastinux at gmail dot com | Date: | Sat, 25 Feb 2012 10:32:46 +0000 |
| Subject: | Req #54859 [Opn->Csd]: GD: image* support for PHP streams | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-167828@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54859&edit=1
ID: 54859
User updated by: dziastinux at gmail dot com
Reported by: dziastinux at gmail dot com
Summary: GD: image* support for PHP streams
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: GD related
Operating System: All
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
And this is the reason why it is feature request.
I found out it is impossible to implement memory stream support.
See: http://stackoverflow.com/questions/6917224/php-memory-php-temp-preserving-stream-data-on-subsequent-handle-creation
Previous Comments:
------------------------------------------------------------------------
[2012-02-25 02:25:45] james dot cohen at gmail dot com
Using output buffering you can capture the output to variables.
It's described in some comments to the documentation:
http://www.php.net/manual/en/function.imagepng.php#53021
------------------------------------------------------------------------
[2011-05-19 11:22:47] dziastinux at gmail dot com
Description:
------------
imagepng/imapgejpg/imagegd.. do not accept PHP streams as string parameter
('php://memory').
Test script:
---------------
$fileName = 'php://memory';
imagepng($image, $fileName);
$imageData = file_get_contents( $fileName );
Actual result:
--------------
Warning: imagepng() [function.imagepng]: Unable to open 'php://memory' for writing:
Invalid argument...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54859&edit=1