Looping through image_lib to create thumbnails |
[eluser]Unknown[/eluser]
Hi I have been coding in CI for a bit now and have gotten pretty far into a project. This is my first real problem I have stumbled into and am not quite sure how to solve it. Here is the code from a controller: Code: $this->load->model('ImageModel'); The weird thing is it writes the first image just fine. But nothing after that, and I am 100% sure it loops through 50 files. All of which are 2000+ px by 1800+ px. So yes, huge files. I have tried increasing php memory through a .htaccess (that's what servage.net says I should do, but not quite sure in which dir to place it.. Should that be with the index.php or in the dir of the libraries? Mind you this is just a test, once it works code will be refined and chopped up to helpers or a library. (What would you recommend of the two, while we're at it? ![]()
[eluser]mironcho[/eluser]
Hi snek, try using $this->image_lib->initialize($imgConfig) instead of load->library (50 times): Code: $this->load->model('ImageModel');
[eluser]Unknown[/eluser]
[quote author="mironcho" date="1209086562"]Hi snek, try using $this->image_lib->initialize($imgConfig) instead of load->library (50 times): [/quote] Ah thanks a lot, that is exactly what I was looking for. I knew loading the library multiple times would not be the right way to do this but I couldn't find any other similar functions. Eventhough CI has great documentation some parts still seem to be lacking since I haven't come across this anywhere.
[eluser]mironcho[/eluser]
No problems! It's hidden in the middle of the page: http://ellislab.com/codeigniter/user-gui...e_lib.html ![]() |
Welcome Guest, Not a member yet? Register Sign In |