[eluser]Pawel K[/eluser]
Hello,
I have been struggling with an issue I posted about a week back. It seems after losts of testing I can not process more than one image in a script. Here is my code:
Code:
#Main Image
$config['image_library'] = 'gd2';
$config['source_image'] = "/home/xxxxxxx/www/cart/images/products/1274642339.jpg";
$config['create_thumb'] = FALSE;
$config['maintain_ratio'] = TRUE;
$config['width'] = $this->config->item('img_width');
$config['height'] = $this->config->item('img_height');
$config['new_image'] = "/home/xxxxx/www/cart/images/products/1-image.jpg";
$this->load->library('image_lib', $config);
if ( ! $this->image_lib->resize())
{
echo "Image 1 errors:".$this->image_lib->display_errors()."<br>";
}
$this->image_lib->clear();
chmod("/home/xxxx/www/cart/images/products/1274643972.jpg", 0777);
#Thumb Image
$config['image_library'] = 'gd2';
$config['source_image'] = "/home/xxxx/www/cart/images/products/1274643972.jpg";
$config['create_thumb'] = FALSE;
$config['maintain_ratio'] = FALSE;
$config['width'] = $this->config->item('thumb_width');
$config['height'] = $this->config->item('thumb_height');
$config['new_image'] = "/home/mesacrea/www/cart/images/products/2-image.jpg";
$this->load->library('image_lib', $config);
if ( ! $this->image_lib->resize())
{
echo "Image 2 errors:".$this->image_lib->display_errors()."<br>";
}
$this->image_lib->clear();
This returns the following error for the second image:
Code:
Your server does not support the GD function required to process this type of image.
The first image is created fine.
Does anyone have an idea why this is happening or suggestions on how to process multiple images correctly? Help would be appreciated.