Welcome Guest, Not a member yet? Register   Sign In
CI creates thumb but won't resize - non-logical error

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:

Thumb created
Resize error: <p>Your server does not support the GD function required to process this type of image.</p>

The success! part is a log message to tell me that the upload went correctly.

below is my code!



$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;
if(!$this->image_lib->resize()) {
    echo "Thumb error: ".$this->image_lib->display_errors()."\n";
} else {
    echo "Thumb created\n";
$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";

The strange thing is that the image for resizing is the same, as is the logic, so since the thumb was indeed created GD shouldn't have any problems processing the resize..

You didn't initialize the image_lib again with your new $config items.

How stupid of me! Thanks, I'll post again if it works (or didn't)


Theme © iAndrew 2016 - Forum software by © MyBB