Welcome Guest, Not a member yet? Register   Sign In
GD library
#1

[eluser]Fatih[/eluser]
Hi,

I use image manipulation class in CI and I get an error message below:

"Your server does not support the GD function required to process this type of image."

But I checked my server. GD library was installed and enabled as given below message:

-bash-2.05b# php -i |grep GD
GD Support enabled
GD Version bundled (2.0.28 compatible)


So, what is the problem do you think? What shall I do to use GD library?
#2

[eluser]xwero[/eluser]
Are you processing a gif image?
#3

[eluser]Fatih[/eluser]
no, jpg and png actually I did. But the results were the same.
#4

[eluser]xwero[/eluser]
check with
Code:
var_dump(gd_info());
To see what functions are supported by the library. Maybe it's installed with some exotic configuration.
#5

[eluser]Fatih[/eluser]
Here is the results:

Code:
array(11) {
["GD Version"]=>  string(27) "bundled (2.0.28 compatible)"
["FreeType Support"]=>  bool(true)
["FreeType Linkage"]=>  string(13) "with freetype"
["T1Lib Support"]=>  bool(false)
["GIF Read Support"]=>  bool(true)
["GIF Create Support"]=>  bool(true)
["JPG Support"]=>  bool(true)
["PNG Support"]=>  bool(true)
["WBMP Support"]=>  bool(true)
["XBM Support"]=>  bool(true)
["JIS-mapped Japanese Font Support"]=>  bool(false)
}

I want to use create thumbnails and watermark function of GD library. Is it possible with this config?
#6

[eluser]xwero[/eluser]
Yes it should be possible i have used it on servers with the same configuration. Maybe someone else can help you, i'm all out of options, i'm sorry.
#7

[eluser]Michael Wales[/eluser]
Are you using:
Code:
$config['image_library'] = 'GD2';

rather than:
Code:
$config['image_library'] = 'GD';
#8

[eluser]Fatih[/eluser]
No, I am using GD library:

Code:
$config['image_library'] = 'GD';

But, my do_upload code is as given below. I can use same config array for uploading and image manipulation. Is there any confusing with $config array for uploading and image manipulation?

Code:
function do_upload()
    {
        $config['upload_path'] = './images/avatars/';
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size']    = '50';
        $config['max_width']  = '500';
        $config['max_height']  = '500';
        
        $this->load->library('upload', $config);
        $temp = $this->upload->do_upload('avatar');
    
        if ( !$temp)
        {
            $data = array('message' => $this->upload->display_errors());
            $this->template->load('mainTemplate', 'error_view', $data);
        }    
        else
        {

            $config['image_library'] = 'GD';
            $config['source_image'] = '/home/sevenly/public_html/ci/images/avatars/'.$this->upload->data('file_name');
            $config['create_thumb'] = TRUE;
            $config['maintain_ratio'] = TRUE;
            $config['width'] = 75;

                $this->load->library('image_lib', $config);
                $img = $this->image_lib->resize();
//echo var_dump(gd_info());                
                if (! $img) {
                    echo $this->image_lib->display_errors();
                
                }else {
                    $data = array('message' => "it should be ok?");
                    $this->template->load('mainTemplate', 'error_view', $data);
                
                }
                $data = array('message' =>var_dump($this->upload->data()));
                $this->template->load('mainTemplate', 'error_view', $data);
        }
    }
#9

[eluser]Michael Wales[/eluser]
You should be using GD2

Code:
["GD Version"]=>  string(27) "bundled (2.0.28 compatible)"
#10

[eluser]Fatih[/eluser]
Sorry but still the same result when I use "GD2" instead of "GD".




Theme © iAndrew 2016 - Forum software by © MyBB