0
$this->load->library('image_lib');
if($imgWidth > $imgHeight){
$img['image_library'] = 'gd2';
$img['source_image'] = 'uploads/img/gallery/small/'.$photo;
$img['maintain_ratio'] = FALSE;
$img['x_axis'] = $imgWidth - $imgHeight;
$img['y_axis'] = 0;
$this->image_lib->initialize($img);
$this->image_lib->crop();
echo $this->image_lib->display_errors();
}
if($imgWidth < $imgHeight){
$img['image_library'] = 'gd2';
$img['source_image'] = 'uploads/img/gallery/small/'.$photo;
$img['create_thumb'] = TRUE;
$img['dinamic_output'] = TRUE;
$img['maintain_ratio'] = FALSE;
$img['x_axis'] = 0;
$img['y_axis'] = $imgHeight-$imgWidth;
$this->image_lib->initialize($img);
$this->image_lib->crop();
echo $this->image_lib->display_errors();
}
$img['image_library'] = 'gd2';
$img['source_image'] = 'uploads/img/gallery/small/'.$photo;
$img['maintain_ratio'] = FALSE;
$img['width'] = 80;
$img['height'] = 80;
$this->image_lib->initialize($img);
$this->image_lib->resize();
echo $this->image_lib->display_errors();
爲什麼仍然不裁剪,但只能調整大小? :(codeigniter image_lib問題?
它也不會返回任何錯誤:/
不知道這將有什麼做什麼導致了問題,但在其中一個設置一個錯字。'「dinamic_output''應該是'」 dynamic_output''。 –