Welcome Guest, Not a member yet? Register   Sign In
[SOLVED]Image resize - not working without thumb

I have been battling at getting the resize function working. At the moment, the resize does not work unless create_thumb is set to true... can anyone spot anything I'm doing wrong??

$config['image_library'] = 'gd2';
            $config['create_thumb'] = FALSE;
            $config['maintain_ratio'] = TRUE;
            $config['overwrite']    = TRUE;
            $config['quality'] = 100;
            $config['width'] = 478;
            $config['master_dim'] = 'width';
            $config['source_image'] = './images/projects/'.$_FILES['image']['name'];

            $this->load->library('image_lib', $config);
            if ( ! $this->image_lib->resize() )
                $data['error'] = $this->image_lib->display_errors();
                $this->template->load('admin_template', '/backend/add_work', $data);

Could it be an issue with file permissions? Setting the 'create_thumb' option to true causes the resize to create another image. I bet setting the 'new_image' config item would also work. Where you're having a problem is with neither - when you want to overwrite the src_image. File permissions make sense.

[eluser]Thorpe Obazee[/eluser]
'source_image'   => $source_image,
//'create_thumb'   => TRUE,
//'thumb_marker'   => '_thumb',
//'new_image'      => './uploads/thumbs/',
'maintain_ratio' => TRUE,
'width'          => 75,
'height'         => 50

I've been using this and I commented out 'create_thumb', 'thumb_marker' and 'new_image' and it targeted the original image. True to what the user_guide said.

Permissions doesn't seem to be the problem if you can overwrite the file anyway.

Btw, change the
$this->load->library('image_lib', $config);

Yeah but where in that code is he "overwriting the file anyway"?

Karloff are you getting any error messages?

[eluser]Thorpe Obazee[/eluser]
[quote author="slowgary" date="1240992677"]Yeah but where in that code is he "overwriting the file anyway"?

Karloff are you getting any error messages?[/quote]

oh. my bad. Perhaps permissions then.

Could also be the gnomes. Gnomes have eaten my code like 12 times already. Really annoying.

Gary, think you may be correct, sound like a permissions prob, obliviously i can create a file fine but overwriting the files cause probs

i'm on a mac, any suggestion on how to possible get around the permissions rob or debug?

i should also note if i chmod teh whole dir then resize it works, and no i'm not getting any errors

*hits head against wall

[eluser]Thorpe Obazee[/eluser]
You should probably chmod it then when you resize files

sounds advice, seems to be an error with chmod

Message: chmod() [function.chmod]: No such file or directory

I'l look into that and get back to you

Theme © iAndrew 2016 - Forum software by © MyBB