2011-04-10 3 views
0

PHP 스크립트로 이미지를 업로드하고 이미지가 너무 크면 이미지 크기를 변경 한 다음 동일한 이미지의 엄지 손가락을 생성하고 싶습니다. 지금은 이미지입니다. 크기가 조정되었지만 엄지 손가락이 어떤 이유로 든 생성되지 않았습니다 ... 오류도 발생하지 않습니다. 여기 는 스크립트입니다동일한 이미지 크기 조정 2 회

 if($image_data['image_width'] > 1024 || $image_data['image_height'] > 768) 
     { 


    $config_resize = array(
      'source_image' => $image_data['full_path'], 
      'new_image' => "./uploads/", 
      'overwrite' => true, 
      'maintain_ratio' => true, 
      'width' => 1024, 
      'height' => 768 
      ); 
    $this->load->library('image_lib', $config_resize); 
    if(! $this->image_lib->resize()) 
     { 
     echo $this->image_lib->display_errors(); 
     } 


    $config_thumb = array(
     'source_image' => $config_resize['source_image'], 
     'new_image' => "./uploads/thumbs/", 
     'maintain_ratio' => true, 
     'width' => 150, 
     'height' => 100 
     ); 
    $this->load->library('image_lib', $config_thumb); 

    if(! $this->image_lib->resize()) 
     { 
     echo $this->image_lib->display_errors(); 
     } 


     } 

답변

2
..... 
..... 

    $config_thumb = array(
       'source_image' => $config_resize['source_image'], 
       'new_image' => "./uploads/thumbs/", 
       'maintain_ratio' => true, 
       'width' => 150, 
       'height' => 100 
       ); 

$this->image_lib->initialize($config_thumb); // <--- !!! 

두 번

을 라이브러리를로드하지 않습니다