View Issue Details

IDProjectCategoryView StatusLast Update
0015246mantisbtreportspublic2016-07-19 04:19
Reporterdregad Assigned Tovboctor  
Status closedResolutionfixed 
Product Version1.2.12 
Target Version2.0.0-beta.1Fixed in Version2.0.0-beta.1 
Summary0015246: JPGraph 3.5.x anti aliasing error in Ubuntu

With the latest available version of JPGraph library (3.5.0b1) and the addition of the Theme system, the default 'Universal' theme forcefully calls $graph->img->SetAntiAliasing() in the SetupGraph method.

In Ubuntu (tested up to 12.10), this results in the graph not being drawn, due to an exception thrown (see attached screenshot for error 25128) because they do not use the php-bundled GD library [1], and the imageantialias() function does not exist.

It's worth noting that in the other available themes, this function call is commented out so the problem does not exist.


Additional Information

This is really a jpgraph issue which should be fixed upstream. However, it would appear that Asial Corporation (owner of JPGraph), is not actively maintaining the product - last release was in Oct 2010 and there are no communication channels to report issues.

TagsNo tags attached.


related to 0009167 closedgrangeway GD Should check for antialiasing in JPGraph 




2012-11-28 13:48


jpgraph_error_25128.png (3,165 bytes)   
jpgraph_error_25128.png (3,165 bytes)   


2012-11-28 14:01

developer   ~0034417

Last edited: 2012-11-28 14:02

There are several possible workarounds for this issue.

  1. Use a modified version of the Universal Theme
  • edit /path/to/jpgraph-3.5/themes/UniversalTheme.class.php
  • locate and comment out line 85: <pre>
    // $graph->img->SetAntiAliasing();
  1. Use another theme as default
  • edit /path/to/jpgraph-3.5/
  • locate line defining DEFAULT_THEME_CLASS
  • change it to your preferred theme (see ./themes for a list of available options)
  1. Define a dummy imageantialias() function

This will effectively disable antialiasing, and can be done in several places, e.g.

  • in /path/to/jpgraph-3.5/ - add the following code in the file <pre>
    // Workaround for JPGraph 3.5 on Ubuntu per 0015246
    if( !function_exists('imageantialias') ) {
    function imageantialias( $image, $enabled ) {
    return false;
  • in /path/to/mantisbt/plugins/MantisGraph/core/graph_api.php <pre>
    diff --git a/plugins/MantisGraph/core/graph_api.php b/plugins/MantisGraph/core/graph_api.php
    index a1597a7..e3b0174 100644
    --- a/plugins/MantisGraph/core/graph_api.php
    +++ b/plugins/MantisGraph/core/graph_api.php
    @@ -24,6 +24,14 @@

    if( OFF == plugin_config_get( 'eczlibrary' ) ) {

  • Workaround for JPGraph 3.5 on Ubuntu per 0015246

  • if( !function_exists('imageantialias') ) {
  • function imageantialias( $image, $enabled ) {
  • return false;
  • }
  • }
  • $t_font_path = get_font_path();
    if( $t_font_path !== '' && !defined('TTF_DIR') ) {
    define( 'TTF_DIR', $t_font_path );