图像处理类(image_lib)裁剪图片无效
前辈,小弟刚接触CI,在工作中遇到一个问题请教,我复制了在线手册中有关图片裁剪的一段程序,但是执行后没有效果,请前辈们多多指教class pictest extends CI_Controller{
public function __construct()
{
parent::__construct();
$this->load->library('image_lib');
}
public function test()
{
$config['image_library'] = 'gd2';
$config['source_image'] = 'E:\\Web\\products_imgs\\index\\001-test.jpg';
$config['x_axis'] = '100';
$config['y_axis'] = '60';
$this->image_lib->initialize($config);
if (!$this->image_lib->crop())
{
echo $this->image_lib->display_errors();
}
else
{
echo 'OK';
}
}
}
运行后应该是图片长度减少100像素,高度减少60像素,但是我运行程序后打开图片,图片尺寸没有变化。
不知错在哪里?
谢谢
页:
[1]