|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41442 imagegd2 under output control
Submitted: 2007-05-18 22:42 UTC Modified: 2007-05-22 09:47 UTC
From: rainer dot collet at gmx dot net Assigned: tony2001 (profile)
Status: Closed Package: GD related
PHP Version: 5.2.2 OS: debian etch
Private report: No CVE-ID: None
 [2007-05-18 22:42 UTC] rainer dot collet at gmx dot net
imagegd2 does not produce valid gd2 image if used under output control

Reproduce code:
$strBinary = file_get_contents('test.jpg');
$resHandle = imagecreatefromstring($strBinary);
$strBinary2 = ob_get_clean();

>>>imagecreatefromstring($strBinary2) issues warning but following works fine:

$strBinary = file_get_contents('test.jpg');
$resHandle = imagecreatefromstring($strBinary);
imagegd2($resHandle, 'test.gd2');
$strBinary2 = file_get_contents('test.gd2');

Expected result:

Actual result:
second call to imagecreatefromstring issues
function.imagecreatefromstring: Passed data is not in 'GD2' format


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-21 08:39 UTC]
Pierre, check this patch out:
 [2007-05-22 08:37 UTC]
Thanks for the patch!

it looks good, go ahead.
 [2007-05-22 09:47 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 11:01:28 2024 UTC