src/class.upload.php
function gdversion($full = false) {
        static $gd_version = null;
        static $gd_full_version = null;
        if ($gd_version === null) {
            if ($this->function_enabled('gd_info')) {
                $gd = gd_info();
                $gd = $gd["GD Version"];
                $regex = "/([\d\.]+)/i";
            } else {
                ob_start();
                phpinfo(8);
                $gd = ob_get_contents();
                ob_end_clean();
                $regex = "/\bgd\s+version\b[^\d\n\r]+?([\d\.]+)/i";
            }
            if (preg_match($regex, $gd, $m)) {
                $gd_full_version = (string) $m[1];
                $gd_version = (float) $m[1];
            } else {
                $gd_full_version = 'none';
                $gd_version = 0;
            }
        }
        if ($full) {
            return $gd_full_version;
        } else {
            return $gd_version;
        }
    }
function gdversion($full = false) {
        static $gd_version = null;
        static $gd_full_version = null;
        if ($gd_version === null) {
            if ($this->function_enabled('gd_info')) {
                $gd = gd_info();
                $gd = $gd["GD Version"];
                $regex = "/([\d\.]+)/i";
            } else {
                ob_start();
                phpinfo(8);
                $gd = ob_get_contents();
                ob_end_clean();
                $regex = "/\bgd\s+version\b[^\d\n\r]+?([\d\.]+)/i";
            }
            if (preg_match($regex, $gd, $m)) {
                $gd_full_version = (string) $m[1];
                $gd_version = (float) $m[1];
            } else {
                $gd_full_version = 'none';
                $gd_version = 0;
            }
        }
        if ($full) {
            return $gd_full_version;
        } else {
            return $gd_version;
        }
    }
function gdversion ( $ full = false ) { static $ gd_version = null ; static $ gd_full_version = null ; if ( $ gd_version === null ) { if ( $ this -> function_enabled ( 'gd_info' ) ) { $ gd = gd_info ( ) ; $ gd = $ gd [ "GD Version" ] ; $ regex = "/([\d\.]+)/i" ; } else { ob_start ( ) ; phpinfo ( 8 ) ; $ gd = ob_get_contents ( ) ; ob_end_clean ( ) ; $ regex = "/\bgd\s+version\b[^\d\n\r]+?([\d\.]+)/i" ; } if ( preg_match ( $ regex , $ gd , $ m ) ) { $ gd_full_version = ( string ) $ m [ 1 ] ; $ gd_version = ( float ) $ m [ 1 ] ; } else { $ gd_full_version = 'none' ; $ gd_version = 0 ; } } if ( $ full ) { return $ gd_full_version ; } else { return $ gd_version ; } }
Returns the version of GD

@access public
@param  boolean  $full Optional flag to get precise version
@return float GD version
Returns the version of GD