Welcome Guest, Not a member yet? Register   Sign In
Resizing image does not work
#2

I fixed it through trial-and error. I'm posting this for the benefit of someone else.

My non-working code:

PHP Code:
        $config['image_library'] = 'gd2';
        $config['source_image'] = './uploads/' $pImage;
        $config['new_image'] = './uploads/000.png';
        $config['maintain_ratio'] = TRUE;
        $config['width']         $pWidth;
        $config['height']       $pHeight;

        $this->CI->load->library('image_lib');
        $this->CI->image_lib->initialize($config);
        $this->CI->image_lib->clear();

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

        

To make it work, I just removed the line:
PHP Code:
$this->CI->image_lib->clear(); 

I found the use of the clear method in another forum but simply removing it worked.
Reply


Messages In This Thread
Resizing image does not work - by itsols - 05-24-2017, 06:07 AM
RE: Resizing image does not work - by itsols - 05-24-2017, 07:15 AM
RE: Resizing image does not work - by Rufnex - 05-24-2017, 07:53 AM
RE: Resizing image does not work - by itsols - 05-24-2017, 09:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB