Advertisement
Armandobs14

Config para geração de thumbnails

Aug 14th, 2013
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. $thumb_path = $album_path.DS."thumbs";
  2. mkdir ($thumb_path,0777);
  3. $config['source_image'] = array();
  4. $config['new_image'] = array();
  5. foreach ($files as $image) {
  6.     $config['image_library'] = 'gd';
  7.     $config['create_thumb'] = TRUE;
  8.     $config['width'] = 200;
  9.     $config['height'] = 200;    
  10.     $config['source_image'] = $album_path.DS.$image;
  11.     $config['new_image'] = $thumb_path.DS;
  12.     $this->load->library('image_lib', $config);
  13.     $this->image_lib->resize();
  14.     if ( ! $this->image_lib->resize()){
  15.         echo $this->image_lib->display_errors();
  16.     }
  17.     $this->image_lib->clear();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement