views:

664

answers:

2

I am making a flashcard builder in Ruby on Rails. What image libraries are recommended for Ruby on Rails?

I've used ImageMagick and I've had memory issues on the servers. I hear ImageScience is good but I don't know if I can scale images and draw words on the images (a la lolcats style.)

+3  A: 

I wrote a rails plugin called FlexImage. The best example of dynamic image creation that uses it is here: http://thewinespies.com/dossier.jpg Which is a dynamically created image base don the data on the homepage here: http://thewinespies.com/

Overlay, scaling, cropping, borders, shadows, text, and a few other things are pretty easy with. Granted I'm a bit biased but I think it rocks. It's mostly designed to be used with an uploaded image as a base but it can be configured to work by transforming a virtual image with model data instead pretty easily.

Check it out.

Oh, and it depends on rMagick, which depends on ImageMagick. But the plugin uses the right tricks to clean up memory after itself. I've used it production without issues.

Squeegy
+1  A: 

I don't think ImageScience is going to be what you want since you want to add words to your image. ImageScience is great for doing just resizing.

If you're not going to be hammering your server with card creation, then I think ImMagick would be a good alternative.

ImMagick is a RMagick replacement that uses ImageMagick directly by constructing chainable commands. So you essentially invoke ImageMagick like it was from the command line, create your image, and then ImageMagick is then out of memory because the command line tool is done executing.

pope