php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tais dot hansen at osd dot dk
New email:
PHP Version: OS:

 

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

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

(test url: "http://www.osd.dk/test/test-ob.php")

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.

Regards,
Tais M. Hansen

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-15 06:49 UTC] sander@php.net
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] sniper@php.net
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.
--------

Closed.

 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Jan 23 16:03:48 2022 UTC