Welcome Guest, Not a member yet? Register   Sign In
Image resizing probelm
#1

[eluser]MianUsman[/eluser]
Hi all,

i m uploading image with codeigniter code its working perfect but when i try to resize image it just fails i have enable GD2 in php setting but problem is still there.

please help me out

thanks in advance

Regards,
Usman Abdul-Razzaq
#2

[eluser]umefarooq[/eluser]
can you upload you code how you are using resizing or check this url

http://makdotgnu.wordpress.com/2009/03/0...deigniter/
#3

[eluser]MianUsman[/eluser]
Code:
function resizeImage($source_image_path,$source_image_name,$new_image_name,$width,$height)
      {    
            
            $config['image_library'] = 'GD2';
            $config['source_image'] = $source_image_path.$source_image_name;
            $config['create_thumb'] = false;
            $config['maintain_ratio'] = TRUE;
            $config['quality'] = '100%';
            $config['new_image'] = $source_image_path.'thumbs/'.$new_image_name.'_'.$source_image_name;    
            $config['width'] = $width;
            $config['height'] = $height;
            $this->load->library('image_lib', $config);
            $this->image_lib->initialize($config);
            if ( ! $this->image_lib->resize())
            {
              echo $this->image_lib->display_errors();
            }

      }


here is my code. thanks for help
#4

[eluser]umefarooq[/eluser]
here
$config['image_library'] = 'GD2';
try this
$config['image_library'] = 'gd2';

and also what error you are getting while resizing image and also check the log also
#5

[eluser]MianUsman[/eluser]
same result image uploaded in destination folder but not resized any thing else that i m missing?
#6

[eluser]umefarooq[/eluser]
hmmm check you destination folder path, you have to little debug

$config['new_image'] = $source_image_path.'thumbs/'.$new_image_name.'_'.$source_image_name;

print_r($config); die();

should be some path problem than use the following

$config['new_image'] = $source_image_path.'/thumbs/'.$new_image_name.'_'.$source_image_name;
#7

[eluser]MianUsman[/eluser]
its printing array fine but not resizing any thing else that i have to do Smile




Theme © iAndrew 2016 - Forum software by © MyBB