Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->load->library('image_lib');
- $config['image_library'] = 'gd2';
- $config['upload_path'] = './assets/uploads';
- $config['allowed_types'] = 'gif|jpg|png|jpeg';
- $config['create_thumb'] = TRUE;
- $config['maintain_ratio'] = TRUE;
- $config['quality'] = '60%';
- $config['width'] = 200;
- $config['height'] = 200;
- $this->load->library('image_lib', $config);
- $this->load->library('upload', $config);
- $this->image_lib->resize()
- if ($this->upload->do_upload('resim')) {
- $data_upload_files = $this->upload->data();
- $image = $data_upload_files['file_name'];
- } else {
- //echo $this->upload->display_errors('<p>', '</p>');
- }
- $config['upload_path'] = './assets/uploads';
- $config['allowed_types'] = 'gif|jpg|png|jpeg';
- $this->load->library('upload', $config);
- if ($this->upload->do_upload('resim')) {
- $file_data = $this->upload->data();
- $resize['image_library'] = 'gd2';
- $resize['create_thumb'] = TRUE;
- $resize['maintain_ratio'] = TRUE;
- $resize['quality'] = '60%';
- $resize['width'] = 200;
- $resize['height'] = 200;
- $resize['source_image'] = $file_data['full_path'];
- $this->load->library('image_lib', $resize);
- if (!$this->image_lib->resize()) {
- echo $this->image_lib->display_errors();
- }
- } else {
- echo $this->upload->display_errors('<p>', '</p>');
- }
Add Comment
Please, Sign In to add comment