libgv-php5 gv::render() function does not output to browser

Bug #702957 reported by Neil Chittenden
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
graphviz (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: graphviz

Ubuntu info:
Description: Ubuntu 10.10
Release: 10.10
libgv-php5:
  Installed: 2.26.3-4

Using the gv::render() function in PHP with two arguments, the binary data of the graph image should be output inline (have tried with several different output types). That is, a web browser should receive the image when visiting the PHP page. Instead, no data is output. This worked on Lucid.

When running the script from the command line, the function works as expected. i.e. binary data is output to stdout. Also when using the 3 argument form of gv::render() to save to a file, accessed via the web, the image file is correctly generated.

Note for testing: you'll need to add the file gv.ini to /etc/php5/apache2/conf.d containing "extension=gv.so" to get the extension loading in PHP. Attached is a PHP file that needs write access from the apache user to the output.log and graph.png files.

Revision history for this message
Neil Chittenden (neilchittenden) wrote :
Revision history for this message
Neil Chittenden (neilchittenden) wrote :

Forgot to add I'm on a 64bit system.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in graphviz (Ubuntu):
status: New → Confirmed
Revision history for this message
Urop (urop) wrote :

I can confirm that the gv::render() method is broken when using the php bindings for recent versions of graphviz.

The attached simple test case works for v2.20.2, but fails for

2.26.3-5ubuntu4 (current detfault libgv-php5 package on Ubuntu 11.10 64bit)
2.28.0 (latest stable, custom built from source)
2.29.201206013.0446 (latest development, custom built from source)

For these later versions it appears to work 'intermittently': It normally fails to render at all, but occasionally gets in a mode where it works for a little while - only to switch back to not rendering again.

Revision history for this message
Urop (urop) wrote :

As far as I understand, the attached code, which uses

gv::renderresult (graph_handle, string format, string outdata);

should render to the outdata string. Since I have not echo'd the string, the attached example should not output anything. However, this code appears to render flawlessly for the following versions of graphviz:

2.26.3-5ubuntu4 (current detfault libgv-php5 package on Ubuntu 11.10 64bit)
2.28.0 (latest stable, custom built from source)
2.29.201206013.0446 (latest development, custom built from source)

which suggests that the renderresult function is not behaving as it is supposed to. It is behaving more like the gv::render function should behave. This example fails to work at all for v2.20.2 - even if the output string is echoed manually.

In summary it looks like the php bindings have been broken since at least v2.20.2 and it would be good if this could be fixed because graphviz without the ability to render is pretty useless. Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.