• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
multiple thumbnails

#1
[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.

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

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.