I am using codeigniter 2.1.2 on Win 8.1

and the following code is not working

$this->load->library('image_lib');

$config['image_library'] = 'GD2';
$config['source_image'] = 'C:/xampp/htdocs/imgt/wall/wallpaper2.jpg';

$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width']     = 75;
$config['height']   = 50;

$this->load->library('image_lib', $config); 

var_dump( $this->image_lib->resize()); // this returns true

What is the problem i checked GD is installed ??

I also tried the same code in 2.2.0 here too not working

Hi, what does returns from:

echo $this->image_lib->display_errors();
Member Avatar for iamthwee

Yes the above will help point us in the right direction.

Could be a number of things, settings write permissions on the directory 777 you might have to set GD2 to lowercase, not sure if that makes any difference?

you might have to set GD2 to lowercase, not sure if that makes any difference?

Good suggestion, but no, the initialize() method uses strotolower() to rewrite the image_library value:

$this->image_library = strtolower($this->image_library);

A part that, it could be permissions, memory or other problems, like uploads size limits...

you can try using the absolute or relative url of the image or try adding

file://

## or

file:///

My Error: "You must specify a source image in your preferences."

Could you help how do I fixed ?

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.