|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13103 Image output functions doesn't work properly with output buffering.
Submitted: 2001-09-03 04:38 UTC Modified: 2001-11-15 19:23 UTC
From: tais dot hansen at osd dot dk Assigned:
Status: Closed Package: Output Control
PHP Version: 4.0.4pl1 OS: FreeBSD 4.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
37 - 4 = ?
Subscribe to this entry?

 [2001-09-03 04:38 UTC] tais dot hansen at osd dot dk

$im = imageCreateFromPNG( "test-ob.png" );
imagePNG( $im );
$outbuffer = ob_get_contents();
header( "Content-Type: image/gif" );
print $outbuffer;

(test url: "")

The script above will fail on the "header( ..." line stating that output has already been sent and thus no more headers can be added.

For some reason the imagePNG() function (and other image output functions) seems to end the header section of the output even though output buffering is active.

I'm currently unable to test this on a newer version of php.

Tais M. Hansen


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-15 06:49 UTC]
Are you sure there is no whitespace before the <?php-tag???

And if that's not the case, can you try the latest snapshot or at least 4.0.6?
 [2001-11-15 19:23 UTC]
User feedback:

I haven't been able to check it in version 4.0.6 until last week. But it
seems like it works in 4.0.6. So I guess case is closed then. Great.


PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Nov 30 11:01:27 2023 UTC