ok here is my view code:
<% for img in ary %>
<%= resize_image img.name %> # img.name= /homa/joe/pictureimg.jpg
<% end %>
here is my resize_image code in application_helper:
pic = Magick::Image.read(imgfile).first
thumb = pic.crop_resized(maxwidth, maxheight,
When “ary” contains 50 images to resize, it goes fast on the first 4
then the whole thing slows down and and the ruby proccess occupies like
of CPU and 70% of memory and then after 15 pics webrick crashes
about how the disk might be full although it`s not.
I think this is because it trys to create all thumbnails at the same
which needs too much cpu and ram.
So my question is: is there any way to make the <% for img in ary %>
wait for the current image to be resized before starting the resize of
thanx in advance