|
foreach ($attachment as $key=>$attachlist){
$this->thread_model->do_image($this->imagewidth,$this->imageheight,$sourcepath.$attachlist['attachment'],$newpath.$jpg);
}
function do_image($width=0,$height=0,$source_image_path=null,$new_image_path=null){
$config = null;
$config['image_library'] = 'gd2';
$config['source_image'] = $source_image_path;
$config['new_image'] = $new_image_path;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = $width;
$config['height'] = $height;
$config['quality'] = "100%";
$config['thumb_marker'] = '';
$this->load->library('image_lib', $config);
if (!$this->image_lib->resize())
echo $this->image_lib->display_errors();
}
请问,$attachment 有三个图片,为什么第一个图片处理完,下面从第二个图片开始就不会再处理了? |
|