Welcome Guest, Not a member yet? Register   Sign In
Resize and watermark: need to set a create_thumb?
#1

[eluser]abmcr[/eluser]
For managing a thumb and a watermark i have encoutered some problems: without set the
Code:
'create_thumb' => false
in the array of watermark configuration, all work fine but the watermark reset the thumb at the original dimension.
With this code all work fine

Code:
$this->load->library('image_lib');
            
        $config['thumbnail'] = array('create_thumb' => TRUE,'source_image'=> ($path.$file),'width' => 100, 'height' => 100, 'maintain_ratio' => TRUE);
        $this->image_lib->initialize($config['thumbnail']);
        $this->image_lib->resize();
        
        $this->image_lib->clear();
        
        $config['watermark'] = array('create_thumb' => false,'source_image'=> ($path.$file),'wm_padding' => '20','wm_hor_alignment'=> 'center','wm_vrt_alignment' => 'middle','wm_font_color' => '000000','wm_font_size'=> '16','wm_font_path'=> realpath('system/fonts/MOSHPIT_.TTF'),'wm_type'=> 'text','wm_text' => 'Copyright 2006 - John Doe',);
        $this->image_lib->initialize($config['watermark']);  
        $this->image_lib->watermark();

The tip is the
Code:
'create_thumb' => false
line for make a watermark on the original image and keep the thumb
I think this is a bug... thank you
#2

[eluser]munko[/eluser]
nice catch,

thank you from CI's newbie




Theme © iAndrew 2016 - Forum software by © MyBB