FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=18366&edit=1

ID: 18366
Updated by: daniel.oconnor@gmail.com
Reported By: dccoao13 at yahoo dot com
Summary: Call to undefined function ps_new()
Status: Open
Type: Bug
Package: Image_Canvas
Operating System: Ubuntu 101.10
Package Version: 0.3.3
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[2011-03-16 16:01:39] daveo

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

------------------------------------------------------------------------

Search Discussions

  • Daniel Oconnor at Jan 2, 2012 at 12:32 am
    Edit report at https://pear.php.net/bugs/bug.php?id=18366&edit=1

    ID: 18366
    Updated by: daniel.oconnor@gmail.com
    Reported By: dccoao13 at yahoo dot com
    Summary: Call to undefined function ps_new()
    -Status: Open
    +Status: Feedback
    Type: Bug
    Package: Image_Canvas
    Operating System: Ubuntu 101.10
    Package Version: 0.3.3
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Feedback



    Previous Comments:
    ------------------------------------------------------------------------

    [2012-01-02 01:32:37] doconnor

    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

    ------------------------------------------------------------------------

    [2011-03-16 16:01:39] daveo

    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

    ------------------------------------------------------------------------
  • Dccoao13 at Jan 4, 2012 at 5:46 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=18366&edit=1

    ID: 18366
    Updated by: dccoao13@yahoo.com
    Reported By: dccoao13 at yahoo dot com
    Summary: Call to undefined function ps_new()
    -Status: Feedback
    +Status: Closed
    Type: Bug
    Package: Image_Canvas
    Operating System: Ubuntu 101.10
    Package Version: 0.3.3
    PHP Version: Irrelevant
    -Assigned To:
    +Assigned To: daveo
    Roadmap Versions:
    New Comment:

    -Status: Feedback
    +Status: Closed
    -Assigned To:
    +Assigned To: daveo
    Yes, you are right. I forgot to retract my claim. My apologies.


    Previous Comments:
    ------------------------------------------------------------------------

    [2012-01-02 01:32:48] doconnor

    -Status: Open
    +Status: Feedback


    ------------------------------------------------------------------------

    [2012-01-02 01:32:37] doconnor

    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

    ------------------------------------------------------------------------

    [2011-03-16 16:01:39] daveo

    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

    ------------------------------------------------------------------------
  • Dccoao13 at Jan 4, 2012 at 5:47 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=18366&edit=1

    ID: 18366
    Updated by: dccoao13@yahoo.com
    Reported By: dccoao13 at yahoo dot com
    Summary: Call to undefined function ps_new()
    Status: Closed
    Type: Bug
    Package: Image_Canvas
    Operating System: Ubuntu 101.10
    Package Version: 0.3.3
    PHP Version: Irrelevant
    Assigned To: daveo
    Roadmap Versions:
    New Comment:

    Yes, you are right. I forgot to retract my claim. My apologies.


    Previous Comments:
    ------------------------------------------------------------------------

    [2012-01-04 18:47:26] daveo

    -Status: Feedback
    +Status: Closed
    -Assigned To:
    +Assigned To: daveo
    Yes, you are right. I forgot to retract my claim. My apologies.

    ------------------------------------------------------------------------

    [2012-01-02 01:32:48] doconnor

    -Status: Open
    +Status: Feedback


    ------------------------------------------------------------------------

    [2012-01-02 01:32:37] doconnor

    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

    ------------------------------------------------------------------------

    [2011-03-16 16:01:39] daveo

    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

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJan 2, '12 at 12:32a
activeJan 4, '12 at 5:47p
posts4
users2
websitepear.php.net

2 users in discussion

Daniel Oconnor: 2 posts Dccoao13: 2 posts

People

Translate

site design / logo © 2022 Grokbase