On 29 Nov 2007, at 02:30, Thufir wrote:
> On Thu, 29 Nov 2007 09:29:25 +0900, Ryan Davis wrote:
>> require 'rubygems'
>> require 'image_science'
>>
>> Dir["*.jpg"].each do |file|
>>    ImageScience.with_image(file) do |img|
>>      img.thumbnail(200) do |thumb|
>>        thumb.save "#{file.sub(/.jpg$/, '')}_thumb.png"
>>      end
>>    end
>> end
>
>
> Very cool :)
>
>
> I'm ok with the ruby, but how would you put that *into* a rails  
> project
> so that the above code is run when the new images are imported to  
> the db?

Have a look at the attachment_fu plugin:

http://svn.techno-weenie.net/projects/plugins/attachment_fu/

Regards,
Andy Stewart

-------
http://airbladesoftware.com