codeigniter图像处理类

时间:2011-10-12 09:45:13

标签: codeigniter

我正在使用ubuntu 11.04 chmod 775 codeigniter 2.0.3代码在控制器中。问题是我无法找到没有生成缩略图的错误。

$base_url =  base_url().'/uploads/';

//This will show \var\www\site\uploads
$base_path = realpath('./uploads/');
$src_name = $this->input->post('filename');//source name
$source_image = realpath($base_path.'/'.$src_name);    
$w = 75;//width
$h = 50;//height

$config['image_library'] = 'gd2';
$config['source_image'] = $source_image;//Full path to the source image
$config['create_thumb'] = TRUE;//create a thumbnail
$config['thumb_marker'] = "_{$w}x{$h}_thumb";//thumbnail indicator. mypic.jpg would   become mypic_thumb.jpg
$config['maintain_ratio'] = TRUE;
$config['width'] = $w;//width
$config['height'] = $h;//height


        $this->load->library('image_lib', $config);

        $this->image_lib->resize();

0 个答案:

没有答案