12 hours spent: Image resize problem |
[eluser]tryacc[/eluser]
Alright, here is my first message on this forum. On my current project, I began using CodeIgniter. Things are going very well, it fastened me. But I have a huge problem on image resizing. Situation: User uploads up to 3 files, each of them goes to the controller seperately. (Uploadify) So, we should imagine in the controller that the user actually uploaded only one file. We have $_POST['email'] info; we create a user profile for it if there is not. Then we first upload the $_FILES to the server (if there is a file and the extension is OK). Then I get the getimagesize of Temporary File, if it's ok for the standart, then go on. If it's a new registered user, we create a folder in the gallery for him/her. Then move the upladed file on it. If the image is too large, we resize it down to a standart image size. Then we create a thumbnail out of it. Then insert the info to the DB. Everything goes OK. Everything. I have added LOTS OF DEBUGS on almost every line for over 12 hours yesterday night and morning. It is certainly about the "$this->image_lib->resize()" function. Image_lib is loaded, initalized but not resized. I debugged source image, it is there. Permissions are 755. Server has GD - bundled 2.xx comp-. Here is the resizing part of the function: Code: if (in_array($fileParts['extension'],$typesArray)) { Ok... DEBUG results: Everything works ok. Image_lib loaded. Initializing done. Never executes $this->image_lib->resize() ..... No errors. On IF CONDITION, it doesnt give TRUE or FALSE. (I tried it out of the IF, alone; same.) PLUS: it works on my localhost. I tried "gd", "gd2", "GD", "GD2" for the image library. No change. Any ideas, please? :'(
[eluser]Twisted1919[/eluser]
Just an idea to save you from the future usage of image lib from ci: http://phpthumb.gxdlabs.com/ Also, things like: if($this->image_lib->initialize($config)) OR if($this->image_lib->clear()) are useless, the initialize()/clear() method returns nothing .
[eluser]tryacc[/eluser]
Hi, Thanks for the link -it's one of the best designed image lib web site, I'll try it right now... And yes, I guessed they return just nothing but... I tried every single thing.... Thank you,
[eluser]tryacc[/eluser]
Could this be a server memory problem? It popped up in my mind, I will test it out.
[eluser]tryacc[/eluser]
max_execution_time 120 120 max_file_uploads 20 20 max_input_nesting_level 64 64 max_input_time 60 60 memory_limit 16M 16M post_max_size 8M 8M precision 14 14 realpath_cache_size 16K 16K upload_max_filesize 4M 4M GD INFO: gd GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.3.7 GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled is the server OK for resizing? I don't really have much knowledge on server things.
[eluser]tryacc[/eluser]
The phpthumb library Twisted1919 gave doesn't work on my server either... It works well on localhost.
[eluser]tryacc[/eluser]
Solved: It was a server issue. They allocated more memory, i suppose. Then it is solved. |
Welcome Guest, Not a member yet? Register Sign In |