# Delay displaying rmagick resizing of uploaded images

**URL:** <https://www.ruby-forum.com/t/delay-displaying-rmagick-resizing-of-uploaded-images/96595>\
**Category:** Rails\
**Created:** [June 30, 2006, 2:13am UTC](https://www.ruby-forum.com/t/delay-displaying-rmagick-resizing-of-uploaded-images/96595 "2006-06-30T02:13:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dan](https://www.ruby-forum.com/u/dan)\
**Post date:** [June 30, 2006, 2:13am UTC](https://www.ruby-forum.com/t/delay-displaying-rmagick-resizing-of-uploaded-images/96595/1 "2006-06-30T02:13:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dan](https://www.ruby-forum.com/u/dan)\
**Post date:** [June 30, 2006, 2:08pm UTC](https://www.ruby-forum.com/t/delay-displaying-rmagick-resizing-of-uploaded-images/96595/2 "2006-06-30T14:08:01Z")

</div>

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
