이미지 업로드를 완료했으며 CI에서 여러 번 크기가 조정되었습니다. 동일한 코드가 한 페이지에서 작동하지만 다른 페이지에서는 작동하지 않습니다. "이 서버는이 유형의 이미지를 처리하는 데 필요한 GD 기능을 지원하지 않습니다."라는 오류 메시지가 표시됩니다. 이미지를 업로드 할 수있는 코드는 이해할 수없는 내가 무슨 일귀하의 서버가이 유형의 이미지를 처리하는 데 필요한 GD 기능을 지원하지 않습니다 .Cy
function do_upload() {
$original_path = './uploads/activity_images/original';
$resized_path = './uploads/activity_images/resized';
$thumbs_path = './uploads/activity_images/thumb';
$this->load->library('image_lib');
$config = array(
'allowed_types' => 'jpg|jpeg|gif|png', //only accept these file types
'max_size' => 2048, //2MB max
'upload_path' => $original_path //upload directory
);
$this->load->library('upload', $config);
$this->upload->do_upload();
$image_data = $this->upload->data(); //upload the image
$image1 = $image_data['file_name'];
//your desired config for the resize() function
$config = array(
'source_image' => $image_data['full_path'], //path to the uploaded image
'new_image' => $resized_path,
'maintain_ratio' => true,
'width' => 128,
'height' => 128
);
$this->image_lib->initialize($config);
$this->image_lib->resize();
// for the Thumbnail image
$config = array(
'source_image' => $image_data['full_path'],
'new_image' => $thumbs_path,
'maintain_ratio' => true,
'width' => 36,
'height' => 36
);
//here is the second thumbnail, notice the call for the initialize() function again
$this->image_lib->initialize($config);
$this->image_lib->resize();
//$this->image_lib->clear();
echo $this->image_lib->display_errors();
var_dump(gd_info());
die();
return $image1;
}
\ ...입니다 .. ??
$original_path = './uploads/activity_images/original';
$resized_path = './uploads/activity_images/resized';
$thumbs_path = './uploads/activity_images/thumb';
$this->load->library('image_lib');
에 :
설치 무엇 'var_dump (gd_info());'는 당신에게 무엇을 제공합니까? –
array 'GD Version'=> 문자열 '번들 (2.0.34 호환)'(길이 = 27) 'FreeType Support'=> 부울 true 'FreeType Linkage'=> 'freetype'(길이 = 13) 'T1Lib 지원'=> 부울 거짓 'GIF 읽기 지원'=> 부울 사실 'GIF 지원 만들기'=> 부울 사실 'JPEG 지원'=> 부울 사실 'PNG 지원'=> 부울 사실 'WBMP 지원 '=> 부울 참 true 'XPM Support '=> 부울 거짓 'XBM Support '=> 부울 참 true 'JIS 매핑 일본 글꼴 지원 '=> 부울 거짓 – Drudge
또한'$ config ['image_library '] = 'gd2'; –