Customer resize helper - in a loop, works once, second generates a GD error |
[eluser]Met[/eluser]
Here's my code (feel free to tear it apart if it's all wrong). Code: <?php I had hoped to be able to do this in my views: Code: <img src="<?php echo resize_img('path/img.jpg', 200, 500); ?> " /> I've also put this in a forloop, and the first instance works fine, but then the second one errors: Quote:<p>Your server does not support the GD function required to process this type of image.</p> Which doesn't make much sense, as it's just processed the first one. I have tried different images, and the "working" image but with a different name to the same effect. If I remove $CI->image_lib->clear();, there is no error, but the image is the same as the first one for each iteration (due to not clearing it). Any ideas? thank you !
[eluser]Met[/eluser]
http://ellislab.com/forums/viewthread/142592/#701077 Solved the problem, by placing image_lib->clear(); before the config, and initializing it manually. Don't quite understand why this has an effect, but it's working now at least. |
Welcome Guest, Not a member yet? Register Sign In |