用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2136|回复: 0
收起左侧

[HELP] 图像处理类(image_lib)裁剪图片无效

[复制链接]
发表于 2012-6-25 17:56:11 | 显示全部楼层 |阅读模式
前辈,小弟刚接触CI,在工作中遇到一个问题请教,我复制了在线手册中有关图片裁剪的一段程序,但是执行后没有效果,请前辈们多多指教

PHP复制代码
 
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像素,但是我运行程序后打开图片,图片尺寸没有变化。
不知错在哪里?

谢谢

本版积分规则