Guest User

Untitled

a guest
Jan 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. $this->load->library('image_lib');
  2. $config['image_library'] = 'gd2';
  3. $config['upload_path'] = './assets/uploads';
  4. $config['allowed_types'] = 'gif|jpg|png|jpeg';
  5. $config['create_thumb'] = TRUE;
  6. $config['maintain_ratio'] = TRUE;
  7. $config['quality'] = '60%';
  8. $config['width'] = 200;
  9. $config['height'] = 200;
  10. $this->load->library('image_lib', $config);
  11. $this->load->library('upload', $config);
  12. $this->image_lib->resize()
  13.  
  14. if ($this->upload->do_upload('resim')) {
  15.  
  16. $data_upload_files = $this->upload->data();
  17. $image = $data_upload_files['file_name'];
  18. } else {
  19. // echo $this->upload->display_errors('<p>', '</p>');
  20.  
  21. }
  22.  
  23. $config['upload_path'] = './assets/uploads';
  24. $config['allowed_types'] = 'gif|jpg|png|jpeg';
  25. $this->load->library('upload', $config);
  26. if ($this->upload->do_upload('resim')) {
  27. $file_data = $this->upload->data();
  28. $resize['image_library'] = 'gd2';
  29. $resize['create_thumb'] = TRUE;
  30. $resize['maintain_ratio'] = TRUE;
  31. $resize['quality'] = '60%';
  32. $resize['width'] = 200;
  33. $resize['height'] = 200;
  34. $resize['source_image'] = $file_data['full_path'];
  35. $this->load->library('image_lib', $resize);
  36. if (!$this->image_lib->resize()) {
  37. echo $this->image_lib->display_errors();
  38. }
  39. } else {
  40. echo $this->upload->display_errors('<p>', '</p>');
  41. }
Add Comment
Please, Sign In to add comment