Welcome Guest, Not a member yet? Register   Sign In
[Solved] Weird image manipulation problem
#1

[eluser]PH-MJS[/eluser]
Hi CI-coders,

I've the following code:
Code:
$this->load->library('image_lib');
//Step 1 Watermark the image
$config['source_image'] = '/absolute/path/to/file.jpg';
$config['wm_type'] = 'overlay';
$config['wm_overlay_path'] = '/absolute/path/to/file.jpg';
$this->image_lib->initialize($config);
$this->image_lib->watermark();
$this->image_lib->clear();

//Step 2 Copy the image
$config['image_library'] = 'gd2';
$config['source_image'] = '/absolute/path/to/file.jpg';
$config['new_image'] = '/absolute/path/to/folder/';
$this->image_lib->initialize($config);  
$this->image_lib->resize();
$this->image_lib->clear();

//Step 3 Create a thumb
$config['image_library'] = 'gd2';
$config['source_image'] = '/absolute/path/to/file.jpg';
$config['new_image'] = '/absolute/path/to/folder/';
$config['width'] = 100;
$config['height'] = 100;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$this->image_lib->initialize($config);
$this->image_lib->resize();
$this->image_lib->clear();

Watermarking is working Big Grin
When I remove the code for create a thumb (step 3) Copy the image works well and the sizes don't change. The naming of the file is also good.

But when I add the code of step 3 Create a thumb, the image is resizing and the naming is good. Without _thumb. It seems that the script skip step 2.

How can this be?

Thanks in advance for your reply,
PH-MJS
#2

[eluser]Federico BaƱa[/eluser]
Are you sure the big image and the thumbnail dont have the same name?
#3

[eluser]PH-MJS[/eluser]
Hey Federico,
That was the problem! Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB