[eluser]matches[/eluser]
Below is the code I am using to create thumb nails. For some reason it works about 1 out of every 30 times. Any idea why?
This is the error I get when it doesn't work:
Quote:The path to the image is not correct.
Your server does not support the GD function required to process this type of image.
Keep in mind I make no changes to the code. I just keep trying and it will eventually create a thumb.
Code:
function _createThumbnail($fileName, $upload_directory) {
$config['image_library'] = 'gd2';
$config['source_image'] = $upload_directory . $fileName;
$config['new_image'] = $upload_directory . $fileName;
$config['dest_image'] = $upload_directory;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 75;
echo $upload_directory . $fileName;
$this->load->library('image_lib', $config);
if(!$this->image_lib->resize()) echo $this->image_lib->display_errors();
}