Guest User

Untitled

a guest
Jul 3rd, 2011
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. private function _resize($file_name, $size) {
  2. $this->load->library( 'image_lib' );
  3.  
  4. $config['image_library'] = 'gd2';
  5. $config['source_image'] = 'img/upload/' . $file_name;
  6. $config['new_image'] = 'img/upload/' . $file_name;
  7. $config['create_thumb'] = TRUE;
  8. $config['thumb_marker'] = '_' . $size;
  9. $config['maintain_ratio'] = FALSE;
  10. $config['width'] = $size;
  11. $config['height'] = $size;
  12.  
  13. $this->image_lib->initialize($config);
  14.  
  15. if (!$this->image_lib->resize()) {
  16. echo $this->image_lib->display_errors();
  17. }
  18. $this->image_lib->clear();
  19. return;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment