Welcome Guest, Not a member yet? Register   Sign In
Upload image --> resize and create thumb
#11

[eluser]Samuel Martins[/eluser]
Fixed Smile i just change

Code:
$this->make_thumb($tempimage, $path);
to
Code:
$this->make_thumb($tempimage);

and change the function, removing..
Code:
$config['new_image'] = $path;

and adding this..
Code:
$configthumb['create_thumb'] = TRUE;
$configthumb['thumb_marker'] = "_thumb";


So, this is the final function:
Code:
public function make_thumb($tempimage)
    {
        $configthumb['image_library'] = 'gd2';
        $configthumb['source_image']    = $tempimage;
        $configthumb['maintain_ratio'] = TRUE;
        $configthumb['create_thumb'] = TRUE;
        $configthumb['thumb_marker'] = "_thumb";
        $configthumb['quality'] = '100';
        $configthumb['width']     = 120;
        $configthumb['height']    = 120;

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


I think in that way. I only have to resize the image one time, and make a thumbnail's image. I just read the Image Manipulation Class to understand the method




Theme © iAndrew 2016 - Forum software by © MyBB