Delay displaying rmagick resizing of uploaded images

Hi,

I am using rmagick to resize a copy of uploaded images and display the
copy as a thumbnail. Once the upload is processed it redirects the user
to a page that should display the thumbnail to the user. The problem is
that the rmagick resize function seems to keep going in the background
after handing the new images url (and control) back to rails, which then
happily renders the page with an image tag that points to the new image.
The problem is that the image hasn’t been saved to disk yet, so the page
has no image to display - refreshing the page immediately works as by
then the image is on disk. Has anyone come across this before or have
any ideas on how to get around it?

cheers,
Dan

dan wrote:

…The problem is
that the rmagick resize function seems to keep going in the background
after handing the new images url (and control) back to rails…

Are you SURE this is what’s happening? I’ve worked with RMagick a fair
amount, but haven’t seen this. You might want to make a log entry right
after img.write and another log entry at the point where the application
gets control back, to make sure what the sequence is. If the
“application got control” entry comes first, you will have verified that
the problem is what you think it is.

–Al Evans