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

Bug #18366 Call to undefined function ps_new()
Submitted: 2011-03-16 20:01 UTC
From: daveo Assigned: daveo
Status: Closed Package: Image_Canvas (version 0.3.3)
PHP Version: Irrelevant OS: Ubuntu 101.10
Roadmaps: (Not assigned)    
Subscription  


 [2011-03-16 20:01 UTC] daveo (Steve Cho)
Description: ------------ PHP Fatal error: Call to undefined function ps_new() in /usr/share/php/Image/Canvas/PS.php on line 312 Test script: --------------- <?php require_once 'Image/Graph.php'; // create the graph $Graph =& Image_Graph::factory('graph', array(400, 300)); // add a TrueType font $Font =& $Graph->addNew('font', 'verdana.ttf'); // set the font size to 11 pixels $Font->setSize(8); $Graph->setFont($Font); $Matrix =& $Graph->addNew('Image_Graph_Layout_Matrix', array(2, 2)); $Graph->add( Image_Graph::vertical( Image_Graph::factory('title', array('X-axis Angle Sample', 12)), Image_Graph::vertical( $Plotarea = Image_Graph::factory('plotarea'), $Legend = Image_Graph::factory('legend'), 90 ), 5 ) ); // create the dataset $Dataset1 =& Image_Graph::factory('random', array(10, 2, 15, false)); $Dataset2 =& Image_Graph::factory('random', array(10, 2, 15, false)); $Dataset3 =& Image_Graph::factory('random', array(10, 2, 15, false)); $Dataset4 =& Image_Graph::factory('random', array(10, 2, 15, false)); $Plotarea =& $Matrix->getEntry(0, 0); $Plot =& $Plotarea->addNew('bar', array(&$Dataset1)); $Plot->setLineColor('gray'); $Plot->setFillColor('red@0.2'); $Plot->setSpacing(2); $Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y); $PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$Marker)); $Plot->setMarker($PointingMarker); $Plotarea->setAxisPadding(1, 'left'); $Plotarea->addNew('title', array('x-axis angle should be at 335', array('size' => 7))); $Plotarea->setAxisPadding(40, 'top'); $AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X); $AxisX->setFontAngle(335); $AxisX->setLabelOption('offset', 10); $AxisX->setFont(&$Font); $AxisX->setFontColor('red@0.5'); $Plotarea =& $Matrix->getEntry(0, 1); $Plot =& $Plotarea->addNew('bar', array(&$Dataset2)); $Plot->setLineColor('gray'); $Plot->setFillColor('blue@0.2'); $Plot->setSpacing(2); $Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y); $PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$Marker)); $Plot->setMarker($PointingMarker); $Plotarea->setAxisPadding(1, 'left'); $Plotarea->addNew('title', array('x-axis angle should be at 90', array('size' => 7))); $Plotarea->setAxisPadding(40, 'top'); $AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X); $AxisX->setFontAngle(90); $AxisX->setLabelOption('offset', 10); $AxisX->setFont(&$Font); $Plotarea =& $Matrix->getEntry(1, 0); $Plot =& $Plotarea->addNew('bar', array(&$Dataset3)); $Plot->setLineColor('gray'); $Plot->setFillColor('orange@0.2'); $Plot->setSpacing(2); $Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y); $PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$Marker)); $Plot->setMarker($PointingMarker); $Plotarea->setAxisPadding(1, 'left'); $Plotarea->addNew('title', array('x-axis angle should be at 45', array('size' => 7))); $Plotarea->setAxisPadding(40, 'top'); $AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X); $AxisX->setFontAngle(45); $AxisX->setLabelOption('offset', 10); $AxisX->setFont(&$Font); // output the graph using the PS canvas $Graph->done(array('filename' => 'foo1.ps')); // create a new PS canvas $Canvas =& Image_Canvas::factory('ps', array( 'width' => 600, 'height' => 400 ) ); // make the graph use this now instead $Graph->setCanvas($Canvas); // 're'-output the graph, but not using the PS canvas $Graph->done(array('filename' => 'foo1.ps')); ?> Expected result: ---------------- PS file Actual result: -------------- PNG file

Comments

 [2012-01-02 06:32 UTC] doconnor (Daniel O'Connor)
Hi Steve, I'm guessing you don't have the postscript pecl extension loaded if you are getting a fatal error? http://au2.php.net/manual/en/ps.setup.php
 [2012-01-02 06:32 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Feedback
 [2012-01-04 23:47 UTC] daveo (Steve Cho)
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: daveo
Yes, you are right. I forgot to retract my claim. My apologies.
 [2012-01-04 23:48 UTC] daveo (Steve Cho)
Yes, you are right. I forgot to retract my claim. My apologies.