[eluser]Fabdrol[/eluser]
Dear fellow developers,
I'm busy with a new (google gears based) photo uploader, and need to do some picture manipulation.
A function does (or has to do) two things, first it creates a thumbnail of 150px by 150px, then it has to take the same source image and create a second "thumb" of 500x800 (max)
Some how, It works when creating the thumb. But then, it stalls and gives te following error:
Code:
Thumb created
Resize error: <p>Your server does not support the GD function required to process this type of image.</p>
success!
The success! part is a log message to tell me that the upload went correctly.
below is my code!
thanks!
Code:
$this->load->library('image_lib');
$config['image_library'] = 'gd2';
$config['source_image'] = $file;
$config['create_thumb'] = true;
$config['maintain_ratio'] = true;
// settings for first (small) thumbnail
$config['thumb_marker'] = '_thumb';
$config['width'] = 150;
$config['height'] = 150;
$this->image_lib->initialize($config);
if(!$this->image_lib->resize()) {
echo "Thumb error: ".$this->image_lib->display_errors()."\n";
} else {
echo "Thumb created\n";
}
$this->image_lib->clear();
$config['thumb_marker'] = '_web';
$config['width'] = 500;
$config['height'] = 800;
if(!$this->image_lib->resize()) {
echo "Resize error: ".$this->image_lib->display_errors()."\n";
} else {
echo "Resized.\n";
}
$this->image_lib->clear();