[eluser]smick[/eluser]
Hi!
So I've encountered a pretty nasty problem doing image resizing. It works up to 3 iterations, then stops outputting images. The script is not necessarily failing since the code below the resize code it processing, but that said, even in it's simplest form, the script still fails to process after 3 iterations.
notes:
image size doesn't seem to matter, if I upload an icon sized imae it still stops at 4 iterations.
If I reorder the image resize scripts, it still stops at 3 iterations.
I've tried raising the time out limit in .htaccess with no results
I've tried raising the timeout limit in php before running the scripts, then flushing it after with no effects.
I'm using the clear() and initialize() functions after image processing.
my code:
Code:
//create med version of image (400 max-width)
$config['image_library'] = 'gd2';
$config['source_image'] = 'assets/images/gallery/' . $data['upload_data']['file_name'];
$config['new_image'] = 'assets/images/gallery/' . $data['upload_data']['raw_name'] . "_med_400" . $data['upload_data']['file_ext'];
$config['maintain_ratio'] = TRUE;
$config['height'] = 30000;
if($data['upload_data']['image_width'] > 400) { $config['width'] = 400; }
else { $config['width'] = $data['upload_data']['image_width']; }
$this->load->library('image_lib', $config);
$this->image_lib->resize();
$this->image_lib->clear();
$this->image_lib->initialize($config);
//create large version of image (550px max-height)
$config['image_library'] = 'gd2';
$config['source_image'] = 'assets/images/gallery/' . $data['upload_data']['file_name'];
$config['new_image'] = 'assets/images/gallery/' . $data['upload_data']['raw_name'] . "_large_550" . $data['upload_data']['file_ext'];
$config['maintain_ratio'] = TRUE;
$config['width'] = 30000;
if($data['upload_data']['image_height'] > 550) { $config['height'] = 550; }
else { $config['height'] = $data['upload_data']['image_height']; }
$this->load->library('image_lib', $config);
$this->image_lib->resize();
$this->image_lib->clear();
$this->image_lib->initialize($config);
//create small version of image (100 max-width)
$config['image_library'] = 'gd2';
$config['source_image'] = 'assets/images/gallery/' . $data['upload_data']['file_name'];
$config['new_image'] = 'assets/images/gallery/' . $data['upload_data']['raw_name'] . "_thumb_100" . $data['upload_data']['file_ext'];
$config['maintain_ratio'] = TRUE;
$config['height'] = 30000;
if($data['upload_data']['image_width'] > 100) { $config['width'] = 100; }
else { $config['width'] = $data['upload_data']['image_width']; }
$this->load->library('image_lib', $config);
$this->image_lib->resize();
$this->image_lib->clear();
$this->image_lib->initialize($config);
//create small version of image (150 max-width)
$config['image_library'] = 'gd2';
$config['source_image'] = 'assets/images/gallery/' . $data['upload_data']['file_name'];
$config['new_image'] = 'assets/images/gallery/' . $data['upload_data']['raw_name'] . "_thumb_150" . $data['upload_data']['file_ext'];
$config['maintain_ratio'] = TRUE;
$config['height'] = 30000;
if($data['upload_data']['image_width'] > 150) { $config['width'] = 150; }
else { $config['width'] = $data['upload_data']['image_width']; }
$this->load->library('image_lib', $config);
$this->image_lib->resize();
$this->image_lib->clear();
$this->image_lib->initialize($config);
I'm holding up the project trying to get this working, so any help is a bailout as far as I'm concerned and very appreciated!
Thanks,