Welcome Guest, Not a member yet? Register   Sign In
Image resize manipulation?
#1

[eluser]solid9[/eluser]
I have this codes below,
I'm not sure which is better?

this one?
Code:
$result = array_unique($filenames);

    //resize images into thumb size and save it into thumbs folder

    foreach($result as $value) {
     $config['image_library'] = 'gd2';
     $config['source_image'] = '/home/xeon9/public_html/barterswapping.com/photo-product/'. $value;    
     $config['new_image'] = '/home/xeon9/public_html/barterswapping.com/thumbs/';  
      
     $config['create_thumb'] = TRUE;
     $config['maintain_ratio'] = TRUE;
     $config['width'] = 150;
     $config['height'] = 100;

    
     $this->load->library('image_lib', $config);
    
     if (!$this->image_lib->resize())
     {
         echo $this->image_lib->display_errors();
     } else {
      echo 'resize done!';  
     }
    }


or this one?
Code:
$result = array_unique($filenames);
//resize images into thumb size and save it into thumbs folder
$config['image_library'] = 'gd2';
$config['new_image'] = '/home/xeon9/public_html/barterswapping.com/thumbs/';  
      
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 150;
$config['height'] = 100;

foreach($result as $value) {
$config['source_image'] = '/home/xeon9/public_html/barterswapping.com/photo-product/'. $value;    

$this->load->library('image_lib', $config);
  
if (!$this->image_lib->resize())
  {
      echo $this->image_lib->display_errors();
  } else {
   echo 'resize done!';  
  }
}

Thanks in advanced.


Messages In This Thread
Image resize manipulation? - by El Forum - 06-11-2012, 10:37 AM
Image resize manipulation? - by El Forum - 06-11-2012, 12:06 PM
Image resize manipulation? - by El Forum - 06-11-2012, 05:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB