CodeIgniter Forums
What is Proper way to create Thumbnail - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: What is Proper way to create Thumbnail (/showthread.php?tid=65196)



What is Proper way to create Thumbnail - nkhan - 05-13-2016


When I resize an image keeping 

Code:
 $config=array(
           'image_library'=>'gd2',
            'source_image' => $image_data['full_path'],  /*Original Image*/
            'create_thumb'=>TRUE,
            'new_image' =>'./uploads/thumbs',
            'maintain_ratio'=>TRUE,
            'width' => 150,
            'height' => 150
        );
        $this->load->library('image_lib', $config);
        $this->image_lib->resize();

 Codeigniter adds the string "_thumb" in the end of the name of resized image. 


How delete that file ?


RE: What is Proper way to create Thumbnail - advoor - 05-13-2016

Once a file is created, you can just use the unlink command: http://php.net/manual/en/function.unlink.php


RE: What is Proper way to create Thumbnail - CINewb - 05-18-2016

If you don't want the "_thumb" part adding to the file name include the parameter create_thumb => false like this:


Code:
 $config=array(
           'image_library'=>'gd2',
            'source_image' => $image_data['full_path'],  /*Original Image*/
            'create_thumb'=>FALSE,
            'new_image' =>'./uploads/thumbs',
            'maintain_ratio'=>TRUE,
            'width' => 150,
            'height' => 150
        );