如何在codeigniter中调整图像大小

i am using codeigniter upload library and i want to resize the image. but when I run the code it save the image but its not resizing the image. here is my php code:

                 $this->load->library('upload');

                 $config['upload_path'] = APPPATH .'../images/student';
                 $config['allowed_types'] = 'gif|jpeg|jpg|png';
                 $config['max_size']      = '2000';
                 $config['maintain_ratio']= FALSE;
                 $config['master_dim']    = 'auto';
                 $config['width']         = 128;
                 $config['height']        = 128;
                 $config['overwrite']     = FALSE;
                 //initialize
                 $this->upload->initialize($config);

As pointed out by @relentless you need to use the Image Manipulation Class. The upload class is only helping you to upload the image, not resize it.

The width and height configurations are there to restrict the size of the image you can upload.

It looks like you need to use the following:

$config['max_width']  = '128';
$config['max_height']  = '128';

note the max_width not width