Batch-process images in a Rails App

Hello list,

I’m building a gallery website in Rails and I’d like to batch-add pictures to a gallery. I’ve developed a similar application in PHP before and I’ve found two ways to do that:

  • Archive the images in a zip file and upload them through a web form;
  • Set up a FTP account for a directory in which image files for the next to-be registered gallery will be placed. In the moment the admin registers the new gallery, the script will look into this directory to get the images

Once the images are collected, the script would then create a non-public folder with the name of the gallery and with three subdirs: /hires, /normal, /thumb. The hi-res images go into hires, then these same images are processed by imagemagick and re-dimensioned into a lower-resolution “normal” image to be shown in the website. The same process happens for the thumbs.

The images shouldn’t be directly accessible by the webserver, they should be served by a rails script (controller?) since the hi-res ones will require additional authentication steps in order to be downloaded.

This php app was written in Cake (a Rails-like framework) and what I did was to put the image processing methods inside a component and then a ImagesController would have a privated method to convert everything through the web interface.

I’m not sure on what would be the best way to implement these in Rails. Maybe a web form that would call a rake task that would in turn execute the whole process?

Any suggestions would be greatly appreciated!



Any ideas?


You can use Backgroundrb. [1]

An example, video conversion with Backgroundrb found in url.

Links: [1]

Regards, Murat