CodeIgniter Forums
making thumb - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: making thumb (/thread-21512.html)



making thumb - El Forum - 08-12-2009

[eluser]ratna[/eluser]
i want to make the thumb of the uploaded images. Images upload successfully but the relevant thumbs being made. plz suggest.


making thumb - El Forum - 08-12-2009

[eluser]pistolPete[/eluser]
[quote author="ratna" date="1250075268"]plz suggest.[/quote]

1. Read the userguide: http://ellislab.com/codeigniter/user-guide/libraries/image_lib.html

2. Post your code.


making thumb - El Forum - 08-12-2009

[eluser]ratna[/eluser]
here is the code !!!!!!!

$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '700';

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

if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('imageResizeV', $error);
}



$config['image_library'] = 'gd2';
$config['source_image'] ='uploads/photoname.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 100;

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

if(!$this->image_lib->resize())
{
echo $this->image_lib->display_errors();
}