Welcome Guest, Not a member yet? Register   Sign In
Image Resizing doesn't work [Solved]
#4

[eluser]catiaresende[/eluser]
Hello again,

Luckily I managed to do the resize. What I did was add the code for the resize function inside the thumbnail creation, instead of creating a new function.
The final code looked like this:

Code:
$config['image_library'] = 'GD2';
        $config['source_image'] = $mainimage;
        $config['create_thumb'] = TRUE;
        $config['maintain_ratio'] = true;
        $config['master_dim'] = 'width';
        $config['width'] = $new_width;
        $config['height'] = $new_height;
        $config['quality'] = '100%';

        $this->load->library('image_lib', $config);
        $this->image_lib->resize();
        if(!$this->image_lib->resize()) echo $this->image_lib->display_errors();

        //Resize
        $config['create_thumb'] = FALSE;
        $config['width']  = 500;
        $config['height']  = 500;
        $this->image_lib->initialize($config);
        $this->image_lib->resize();
        
        $config['image_library'] = 'GD2';
        $config['source_image'] = $t;
        $config['create_thumb'] = FALSE;
        $config['width'] = $final_width;
        $config['height'] = $final_height;
        $config['x_axis'] = $to_crop_left;
        $config['y_axis'] = $to_crop_top;
        $config['maintain_ratio'] = false;

        $this->image_lib->initialize($config);
        if(!$this->image_lib->crop()) {
            echo $this->image_lib->display_errors();
        } else {
            $this->gallery_tbl->insertImage($_POST['id'], $newname, $thumbname);


Thanks again.


Messages In This Thread
Image Resizing doesn't work [Solved] - by El Forum - 01-14-2011, 02:26 PM
Image Resizing doesn't work [Solved] - by El Forum - 01-14-2011, 03:20 PM
Image Resizing doesn't work [Solved] - by El Forum - 01-14-2011, 08:30 PM
Image Resizing doesn't work [Solved] - by El Forum - 01-14-2011, 08:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB