php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45832 Unable to write to user-defined stream by imagejpeg()
Submitted: 2008-08-15 12:31 UTC Modified: 2008-08-15 15:27 UTC
From: vrana@php.net Assigned:
Status: Not a bug Package: GD related
PHP Version: 5.2.6 OS: Windows
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: vrana@php.net
New email:
PHP Version: OS:

 

 [2008-08-15 12:31 UTC] vrana@php.net
Description:
------------
Function imagejpeg() is not able to write to the user-defined stream.

[I think it is caused by the fact that _php_image_output_ctx() uses VCWD_FOPEN() instead of php_stream_open_wrapper() - but I'm not an expert.]

Reproduce code:
---------------
imagejpeg(imagecreatefromjpeg("x.jpg"), "var://myvar");

"var" protocol defined as an example in http://www.php.net/stream_wrapper_register

Expected result:
----------------
Image successfully copied to the variable.

Actual result:
--------------
Warning: imagejpeg(): Unable to open 'var://myvar' for writing: Invalid argument

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-15 15:27 UTC] jani@php.net
See bug #39263
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 04:01:38 2025 UTC