php - Codeigniter image resize library not working properly -
php - Codeigniter image resize library not working properly -
for($i=0; $i< count($data['upload_data']); $i++){ //resize uploade image $config['image_library'] = 'gd2'; $config['source_image'] = $data['upload_data'][$i]['full_path']; $config['new_image'] = $data['upload_data'][$i]['full_path']; $config['maintain_ratio'] = true; $config['width'] = 700; $config['height'] = 700; $this->load->library('image_lib', $config); $this->image_lib->resize(); $this->image_lib->clear(); }
i want resize images in loop, images in database, after running script, first image resized.
all path correct, else encountering problem?
after loading image_lib might need initialize it.
$this->load->library('image_lib', $config); $this->image_lib->initialize($config);
see: https://ellislab.com/codeigniter/user-guide/libraries/image_lib.html
you not need utilize $this->image_lib->initialize function if save preferences in config file.
php codeigniter
Comments
Post a Comment