Welcome Guest, Not a member yet? Register   Sign In
Image lib : persistent config values
#1

[eluser]xwero[/eluser]
I have following code
Code:
$config['source_image'] = $upload['full_path'];
$config['maintain_ratio'] = TRUE;
$config['create_thumb'] = TRUE;
$config['width'] = $this->ci->config->item('cms_foto_fullwidth');
                    
$this->ci->image_lib->initialize($config);
                    
$this->ci->image_lib->resize();
                    
$big = $upload['file_name'];
$thumb = $upload['raw_name'].'_thumb'.$upload['file_ext'];
//thumb
$config2['source_image'] = $upload['file_path'].$thumb;
$config2['maintain_ratio'] = TRUE;
$config2['create_thumb'] = false;
$config2['width'] = $this->ci->config->item('cms_foto_thumbwidth');
                        
$this->ci->image_lib->initialize($config2);
                        
$this->ci->image_lib->resize();
I had to set the create_thumb to false otherwise i ended up having files with names like file_thumb_thumb.jpg. I suspected when initializing a configuration the previous configuration gets removed.

I currently working with the 1.5.4 version but i don't remember seeing changes of the image_lib class.

Another thing that is odd about the code is that you can create a thumb but you can't add the size of the thumb to the configuration, or is there a configuration i'm not aware of?
If it gets added maybe it's possible to add a percentage in addition of a defined width?
#2

[eluser]xwero[/eluser]
There is a clear method i didn't notice before so the problem is void. But it would be great it could be added to the initialize method.




Theme © iAndrew 2016 - Forum software by © MyBB