Take the 2-minute tour ×

i'm using ubuntu 11.04 chmod 775 codeigniter 2.0.3 the code was in controller. the problem is i cant find what is wrong not generating thumbnail.

$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


share|improve this question
Are you getting any errors? Have you tried using 777 instead of 775?. In $source_image don't use realpath again (You already created the real upload path in $base_path). –  juanrossi Oct 12 '11 at 17:11
777 is not safe. ive already change $source_image = $base_path.'/'.$src_name; still nothing happens –  Dreathlord Oct 13 '11 at 1:52
'path/to/image' what im using localhost/codeigniter/images/image.jpg or /var/www/codeigniter/images/image.jpg what i am using –  Dreathlord Oct 13 '11 at 2:53

Your Answer



Browse other questions tagged or ask your own question.