CodeIgniter Forums
multiple thumbnails - 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: multiple thumbnails (/showthread.php?tid=3433)



multiple thumbnails - El Forum - 10-01-2007

[eluser]matt2012[/eluser]
Ok I upload an image and I want to create two thumbnails

Code:
$config2['create_thumb'] = TRUE;
        $config2['maintain_ratio'] = TRUE;
        $config2['width'] = 150;
        $config2['height'] = 100;
        $config2['thumb_marker'] = '_thumb2';
        
        $config3['create_thumb'] = TRUE;
        $config3['maintain_ratio'] = TRUE;
        $config3['width'] = 300;
        $config3['height'] = 200;
        $config3['thumb_marker'] = '_thumb';


/..../

        $config2['source_image'] = $data['upload_data']['full_path'];
        $config3['source_image'] = $data['upload_data']['full_path'];
        $this->load->library('image_lib', $config2);
        $this->image_lib->resize();    
        $this->load->library('image_lib', $config3);
        $this->image_lib->resize();

The problem is only the first thumbnail is created

id there a reset switch I need to call?

All help appreciated.

Matt.


multiple thumbnails - El Forum - 10-01-2007

[eluser]matt2012[/eluser]
Ok I found the answer,to reinitialise you need to add this.

Code:
$this->image_lib->initialize($config);