src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
function Image_Toolbox()
    {
        $args = func_get_args();
        $argc = func_num_args();

        //get GD information. see what types we can handle
        $gd_info = function_exists('gd_info') ? gd_info() : $this->_gd_info();
        preg_match("/\A[\D]*([\d+\.]*)[\D]*\Z/", $gd_info['GD Version'], $matches);
        list($this->_gd_version_string, $this->_gd_version_number) = $matches;
        $this->_gd_version = substr($this->_gd_version_number, 0, strpos($this->_gd_version_number, '.'));
        if ($this->_gd_version >= 2)
        {
            $this->_imagecreatefunction = 'imagecreatetruecolor';
            $this->_resize_function = 'imagecopyresampled';
        }
        else
        {
            $this->_imagecreatefunction = 'imagecreate';
            $this->_resize_function = 'imagecopyresized';
        }

        $this->_gd_ttf = $gd_info['FreeType Support'];
        $this->_gd_ps = $gd_info['T1Lib Support'];

        if (isset($gd_info['GIF Read Support']))
        {
            $this->_types[1]['supported'] = 1;
            if ($gd_info['GIF Create Support'])
            {
                $this->_types[1]['supported'] = 2;
            }
        }
        if (isset($gd_info['JPEG Support']) || isset($gd_info['JPG Support']))
        {
            $this->_types[2]['supported'] = 2;
        }
        if (isset($gd_info['PNG Support']))
        {
            $this->_types[3]['supported'] = 2;
        }

        //load or create main image
        if ($argc == 0)
        {
            return true;
        }
        else
        {
            if ($this->_addImage($argc, $args))
            {
                foreach ($this->_img['operator'] as $key => $value)
                {
                    $this->_img['main'][$key] = $value;
                }
                $this->_img['main']['output_type'] = $this->_img['main']['type'];
                unset($this->_img['operator']);
                return true;
            }
            else
            {
                //trigger_error($this->_error_prefix . 'No appropriate constructor found.', E_USER_ERROR);
                return null;
            }
        }
    }
function Image_Toolbox()
    {
        $args = func_get_args();
        $argc = func_num_args();

        //get GD information. see what types we can handle
        $gd_info = function_exists('gd_info') ? gd_info() : $this->_gd_info();
        preg_match("/\A[\D]*([\d+\.]*)[\D]*\Z/", $gd_info['GD Version'], $matches);
        list($this->_gd_version_string, $this->_gd_version_number) = $matches;
        $this->_gd_version = substr($this->_gd_version_number, 0, strpos($this->_gd_version_number, '.'));
        if ($this->_gd_version >= 2)
        {
            $this->_imagecreatefunction = 'imagecreatetruecolor';
            $this->_resize_function = 'imagecopyresampled';
        }
        else
        {
            $this->_imagecreatefunction = 'imagecreate';
            $this->_resize_function = 'imagecopyresized';
        }

        $this->_gd_ttf = $gd_info['FreeType Support'];
        $this->_gd_ps = $gd_info['T1Lib Support'];

        if (isset($gd_info['GIF Read Support']))
        {
            $this->_types[1]['supported'] = 1;
            if ($gd_info['GIF Create Support'])
            {
                $this->_types[1]['supported'] = 2;
            }
        }
        if (isset($gd_info['JPEG Support']) || isset($gd_info['JPG Support']))
        {
            $this->_types[2]['supported'] = 2;
        }
        if (isset($gd_info['PNG Support']))
        {
            $this->_types[3]['supported'] = 2;
        }

        //load or create main image
        if ($argc == 0)
        {
            return true;
        }
        else
        {
            if ($this->_addImage($argc, $args))
            {
                foreach ($this->_img['operator'] as $key => $value)
                {
                    $this->_img['main'][$key] = $value;
                }
                $this->_img['main']['output_type'] = $this->_img['main']['type'];
                unset($this->_img['operator']);
                return true;
            }
            else
            {
                //trigger_error($this->_error_prefix . 'No appropriate constructor found.', E_USER_ERROR);
                return null;
            }
        }
    }
function Image_Toolbox ( ) { $ args = func_get_args ( ) ; $ argc = func_num_args ( ) ; //get GD information. see what types we can handle $ gd_info = function_exists ( 'gd_info' ) ? gd_info ( ) : $ this -> _gd_info ( ) ; preg_match ( "/\A[\D]*([\d+\.]*)[\D]*\Z/" , $ gd_info [ 'GD Version' ] , $ matches ) ; list ( $ this -> _gd_version_string , $ this -> _gd_version_number ) = $ matches ; $ this -> _gd_version = substr ( $ this -> _gd_version_number , 0 , strpos ( $ this -> _gd_version_number , '.' ) ) ; if ( $ this -> _gd_version >= 2 ) { $ this -> _imagecreatefunction = 'imagecreatetruecolor' ; $ this -> _resize_function = 'imagecopyresampled' ; } else { $ this -> _imagecreatefunction = 'imagecreate' ; $ this -> _resize_function = 'imagecopyresized' ; } $ this -> _gd_ttf = $ gd_info [ 'FreeType Support' ] ; $ this -> _gd_ps = $ gd_info [ 'T1Lib Support' ] ; if ( isset ( $ gd_info [ 'GIF Read Support' ] ) ) { $ this -> _types [ 1 ] [ 'supported' ] = 1 ; if ( $ gd_info [ 'GIF Create Support' ] ) { $ this -> _types [ 1 ] [ 'supported' ] = 2 ; } } if ( isset ( $ gd_info [ 'JPEG Support' ] ) || isset ( $ gd_info [ 'JPG Support' ] ) ) { $ this -> _types [ 2 ] [ 'supported' ] = 2 ; } if ( isset ( $ gd_info [ 'PNG Support' ] ) ) { $ this -> _types [ 3 ] [ 'supported' ] = 2 ; } //load or create main image if ( $ argc == 0 ) { return true ; } else { if ( $ this -> _addImage ( $ argc , $ args ) ) { foreach ( $ this -> _img [ 'operator' ] as $ key => $ value ) { $ this -> _img [ 'main' ] [ $ key ] = $ value ; } $ this -> _img [ 'main' ] [ 'output_type' ] = $ this -> _img [ 'main' ] [ 'type' ] ; unset ( $ this -> _img [ 'operator' ] ) ; return true ; } else { //trigger_error($this->_error_prefix . 'No appropriate constructor found.', E_USER_ERROR); return null ; } } }
The class constructor.

Determines the image features of the server and sets the according values.<br>
Additionally you can specify a image to be created/loaded. like {@link addImage() addImage}.

If no parameter is given, no image resource will be generated<br>
Or:<br>
<i>string</i> <b>$file</b> imagefile to load<br>
Or:<br>
<i>integer</i> <b>$width</b> imagewidth of new image to be created<br>
<i>integer</i> <b>$height</b> imageheight of new image to be created<br>
<i>string</i> <b>$fillcolor</b> optional fill the new image with this color (hexformat, e.g. '#FF0000')<br>
The class constructor .