CodeIgniter Forums
Resize and watermark: need to set a create_thumb? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Resize and watermark: need to set a create_thumb? (/showthread.php?tid=14728)



Resize and watermark: need to set a create_thumb? - El Forum - 01-13-2009

[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


Resize and watermark: need to set a create_thumb? - El Forum - 04-22-2009

[eluser]munko[/eluser]
nice catch,

thank you from CI's newbie