Welcome Guest, Not a member yet? Register   Sign In
What is Proper way to create Thumbnail
#1
Question 


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 ?
Reply
#2

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

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
        );
Reply




Theme © iAndrew 2016 - Forum software by © MyBB