CopyPastor

Detecting plagiarism made easy.

Score: 1.827991247177124; Reported for: Open both answers

Possible Plagiarism

Plagiarized on 2018-03-10
by Gufran Hasan

Original Post

Original - Posted on 2013-10-07
by Andrei Zhamoida



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Hwy please try this code to resize the image in CodeIgniter.
$this->load->library('image_lib'); foreach($results as $row) { $config['image_library'] = 'gd2'; $config['source_image'] = '/img/proizvodi/'.$row->proizvodid.'.jpg'; $config['create_thumb'] = TRUE; $config['maintain_ratio'] = TRUE; $config['width'] = 75; $config['height'] = 50; $this->image_lib->clear(); $this->image_lib->initialize($config); $this->image_lib->resize(); }
If it' not work then please check folder permission.
You shouldn't load image_lib in foreach. Try to use code below
$this->load->library('image_lib'); foreach($results as $row) { $config['image_library'] = 'gd2'; $config['source_image'] = '/img/proizvodi/'.$row->proizvodid.'.jpg'; $config['create_thumb'] = TRUE; $config['maintain_ratio'] = TRUE; $config['width'] = 75; $config['height'] = 50;
$this->image_lib->clear(); $this->image_lib->initialize($config); $this->image_lib->resize(); }
If it wont work - check the upload folder permissions.

        
Present in both answers; Present only in the new answer; Present only in the old answer;