Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0

Bug #109 image() calls header() for non-binary imagemap-data
Submitted: 2003-10-16 12:49 UTC
From: winkelmann at someon dot com Assigned: sebastian
Status: Closed Package: Image_GraphViz
PHP Version: 4.3.3 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
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:
2004-02-25 10:27 UTC
Package:
Bug Type:
Summary:
From: winkelmann at someon dot com
New email:
PHP Version: Package Version: OS:

 

 [2003-10-16 12:49 UTC] winkelmann at someon dot com
Description: ------------ The image-method tries to set the contentlenght-header independent of file format. This results in a warning when Graphviz is used to generate a Imagemap inside a html page. Solution: Add a format check around the header(); in line 121 Reproduce code: --------------- $map = new Graphviz; $map->AddNode(...); echo '<map name="dependencies">'; $map->Image('cmap'); echo '</map>';

Comments

 [2004-02-20 08:39 UTC] sebastian at php dot net
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.
 [2004-02-22 10:41 UTC] winkelmann at someon dot com
This Bug has not been fixed. In version 1.20 (Feb.20), this bug is still open.
 [2004-02-22 11:18 UTC] sebastian at php dot net
Sorry for closing this bug before, I misread your report. Does the patch below solve the problem for you? Index: GraphViz.php =================================================================== RCS file: /repository/pear/Image_GraphViz/GraphViz.php,v retrieving revision 1.20 diff -u -r1.20 GraphViz.php --- GraphViz.php 20 Feb 2004 08:47:25 -0000 1.20 +++ GraphViz.php 22 Feb 2004 11:23:58 -0000 @@ -106,6 +106,8 @@ @`$command`; @unlink($file); + $sendContentLengthHeader = true; + switch ($format) { case 'gif': case 'png': @@ -128,9 +130,15 @@ header('Content-Type: image/svg+xml'); } break; + + default: { + $sendContentLengthHeader = false; + } } - header('Content-Length: ' . filesize($outputfile)); + if ($sendContentLengthHeader) { + header('Content-Length: ' . filesize($outputfile)); + } $fp = fopen($outputfile, 'rb');
 [2004-02-25 10:27 UTC] sebastian at php dot net
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.