JpGraph Error 25128

PHPのお絵描きライブラリーであるJpGraph(4.2.6)をとある無料サーバーで使ったところ、25128というエラーになってしまった。

PHPのバージョンを5.4とかにすればエラーは出ないのだが、5.5とか、7.1とかにするとエラーになる。

ググったところ、gd_image.inc.phpのSetAntiAliasing()のエラーを吐いている箇所をコメントにすればよいらしい。

    // Should we use anti-aliasing. Note: This really slows down graphics!
    function SetAntiAliasing($aFlg=true) {
        $this->use_anti_aliasing = $aFlg;
        if( function_exists('imageantialias') ) {
            imageantialias($this->img,$aFlg);
        }
        else {
            // JpGraphError::RaiseL(25128);//('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.')
        }
    }

ただし、これをやるとアンチエイリアスが無効になるので、グラフの線が汚くなってしまう。

エラーメッセージの通り、システムのPHPの設定を変えることができればよいのだろうが。
仕方ないか…

【参考URL】
http://colekcolek.com/2012/05/16/how-to-fix-jpgraph-error-the-function-imageantialias-is-not-available/
http://sookibizviz.blog81.fc2.com/blog-entry-1633.html
https://support.severalnines.com/hc/en-us/articles/212425843

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)

This site uses Akismet to reduce spam. Learn how your comment data is processed.