Problem with image manipulation (resizing) |
[eluser]tommizzle[/eluser]
Hi all, I'm currently having a problem with resizing an image using CI's image manipulation class. Here is my controller: Code: <?php and my view: Code: <?php The image is uploading, and then I'm even getting 'Resize Success', but it's not resizing or creating a new thumb in my chosen dir. I tried the normal 'GD' library too, and that didn't work either. Has anybody got any ideas what's going wrong here? Any help would be appreciated Thanks guys! Tom
[eluser]hugle[/eluser]
hm... I've been using this lib a while ago with no problems... Is the directory you are writing thumb writeable? echo the $config['source_image']; what does it show?
[eluser]tommizzle[/eluser]
Hi hugle, source_image shows: ./images/profile/11.jpg (Correct path to my image, not sure about the dot though?) The directory and the files in it are 777'd Thanks, Tom Edit: Just checked my log, and I'm getting this error: Code: ERROR - 2009-11-16 04:23:30 --> The session cookie data did not match what was expected. This could be a possible hacking attempt.
[eluser]tommizzle[/eluser]
Solved the problem: There is an error in the documentation on: http://ellislab.com/codeigniter/user-gui...e_lib.html Quote:$config['image_library'] = 'gd2'; Pretty frustrating stuff. Especially as I've spent ~2 days on it :/
[eluser]hugle[/eluser]
[quote author="tommizzle" date="1258389238"]Solved the problem: There is an error in the documentation on: http://ellislab.com/codeigniter/user-gui...e_lib.html Quote:$config['image_library'] = 'gd2'; Pretty frustrating stuff. Especially as I've spent ~2 days on it :/[/quote] bah... so bad sometimes it's good to leave of the pc for 20 minutes, and come back and start from the beginning, but not searching for errors... sometimes happen!))
[eluser]Unknown[/eluser]
aw snap. just spent 3 hours on this same one. i really could have used the fixed docs.
[eluser]Craig300[/eluser]
There isn't really a problem with the documentation it all depends if you have already initialised the library already in the file. If you have, then you just need to initialise it with the array values you pass to it. If you haven't initialised the library, then you can do both at the same time by calling $this->load->library('image_lib', $config);
[eluser]stef25[/eluser]
That's true, my bad. It's just that in the docs it first says Code: $this->load->library('image_lib'); and then right below that again Code: $this->load->library('image_lib', $config); That's what's confusing ...
[eluser]Craig300[/eluser]
That got me for a while as well, maybe it could be a bit clearer but once you see whats happening, it kind of makes sense Glad I could help |
Welcome Guest, Not a member yet? Register Sign In |