views:

24

answers:

1

So, the thing is. I'm building my first rails app which reads images from a directory and it's subdirs. Now, I want to generate dynamic thumbnails of those images. But I don't want to fill up that directory with the thumbnail images. I was thinking of caching these thumbs separately for each user in temporary directory.

Oh, and, I would also need the dimensions of the images for some css magic.

What plugins/gems/... should I use to accomplish this?

+1  A: 

You should rmagick coupled with Paperclip. In this way you can specify the dimensions (and many other attributes of the images), and make thumbnails on the fly.

On top of this, I would also add in delayed_job which will background the process of the images so if any of them are provided by the client, they won't have to wait for it to complete client-side.

rMagick : http://github.com/rmagick/rmagick

Paperclip: http://github.com/thoughtbot/paperclip

delayed_job: http://github.com/collectiveidea/delayed_job

Trip
+1. `delayed_job` is not necessarily part of the equation, but still very useful. Here's the obligated tutorial if you wanna learn more http://railscasts.com/episodes/134-paperclip
Chubas
Sweet, thanks guys!
AESM