php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54859 GD: image* support for PHP streams
Submitted: 2011-05-19 11:22 UTC Modified: 2012-02-25 10:32 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dziastinux at gmail dot com Assigned:
Status: Closed Package: GD related
PHP Version: 5.3.6 OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dziastinux at gmail dot com
New email:
PHP Version: OS:

 

 [2011-05-19 11:22 UTC] 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...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-20 23:52 UTC] felipe@php.net
-Type: Bug +Type: Feature/Change Request
 [2012-02-25 02:25 UTC] 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
 [2012-02-25 10:32 UTC] dziastinux at gmail dot com
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
 [2012-02-25 10:32 UTC] dziastinux at gmail dot com
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC