Welcome Guest, Not a member yet? Register   Sign In
Resize in different sizes
#2

Guys, let's say I've solved it.

Now the uploaded image is resized in the different sizes, but I would like to have the same encrypted name in size 16x16 but with extension .ico

Code:
$config['image_library'] = 'gd2';
$config['source_image'] = $image_data['full_path']; //get original image
$config['maintain_ratio'] = TRUE;
     $config['width'] = 16;
                   $config['height'] = 16;
                   $config['new_image'] = './upload/16/'.$image_data['file_name'];
                   $this->load->library('image_lib', $config);
                   $this->image_lib->initialize($config);
                   
                   if (!$this->image_lib->resize()) {
                       $this->handle_error($this->image_lib->display_errors());
                   }

I was thinking of doing this in the simple way, but unfortunately I'm mistaken:

Code:
$config['image_library'] = 'gd2';
$config['source_image'] = $image_data['full_path']; //get original image
$config['maintain_ratio'] = TRUE;
     $config['width'] = 16;
                   $config['height'] = 16;
                   $config['new_image'] = './upload/16/favicon.ico'; // ************* change *******************
                   $this->load->library('image_lib', $config);
                   $this->image_lib->initialize($config);
                   
                   if (!$this->image_lib->resize()) {
                       $this->handle_error($this->image_lib->display_errors());
                   }
Reply


Messages In This Thread
Resize in different sizes - by Marcolino92 - 10-27-2017, 07:37 AM
RE: Resize in different sizes - by Marcolino92 - 10-28-2017, 01:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB