[eluser]spedax[/eluser]
Hi, if been trying to resize 2 images after each other, and it keeps acting weird.
My first image resizes correctly, to 200x200. The second picture resizes to 200 with and a random height, for no known reason.
Anyone know what might be wrong ?
Code:
// crop stuff
$config['image_library'] = 'gd2';
$config['source_image'] = $_SERVER['DOCUMENT_ROOT'].'/images/design/'.$newname;
$config['new_image'] = $_SERVER['DOCUMENT_ROOT'].'/images/design/thumb/'.$newname;
$config['width'] = '200';
$config['height'] = '200';
$config['maintain_ratio'] = FALSE;
$this->load->library('image_lib', $config);
if ( ! $this->image_lib->resize())
{
die($this->image_lib->display_errors());
}
$this->image_lib->clear();
// crop stuff
$config2['image_library'] = 'gd2';
$config2['source_image'] = $_SERVER['DOCUMENT_ROOT'].'/images/design/'.$newname;
$config2['new_image'] = $_SERVER['DOCUMENT_ROOT'].'/images/design/canvas/'.$newname;
$config2['width'] = '900';
$config2['maintain_ratio'] = TRUE;
$this->load->library('image_lib', $config2);
if ( ! $this->image_lib->resize())
{
die($this->image_lib->display_errors());
}
if tried multiple things but nothing seems to help