views:

44

answers:

2

We're building a piece of forum software for a client. On posts, they want users to be able to upload images (we're using paperclip right now) to insert into the body of the post (similar to wordpress). But they want the system to be able to detect if a number of photos are grouped together, and if so show them in a gallery view (thumbnails as navigation, etc.) vs. showing them one after the other.

Has anyone done anything like this before? Any plugins (rails or JQuery) that would help?

EDIT: Just to clarify - we're not having any problems uploading and resizing images, and we don't have any issues displaying them either inline or as a gallery. What I can't figure out is how to have the system detect whether there is only one image inline or multiple images, and responding accordingly.

For example, if you have a document like this:

lorem ipsum lorem ipsum lorem ipsum

IMAGE

lorem ipsum lorem ipsum lorem ipsum

IMAGE IMAGE IMAGE

lorem ipsum lorem ipsum lorem ipsum

IMAGE

lorem ipsum lorem ipsum

The system needs to know to take the three images in the middle and group them into a gallery automatically, while rending the other two individual images by themselves.

A: 

In Ruby use RMagick to re-size images and create thumbnails.

Not sure what you want on jquery presentation, but here are a bunch of options: http://sixrevisions.com/resources/14-jquery-plugins-for-working-with-images/

Joelio
Thanks - I don't think I was being specific enough in what we're trying to accomplish. I've updated the question to be more thorough.
Sean Johnson
A: 

There are lots of jQuery options out there, but Galleria is a particularly nice-looking one. Just include the plugin, theme and call it on the parent container of your images.

scronide
Thanks - I don't think I was being specific enough in what we're trying to accomplish. I've updated the question to be more thorough. Galleria is pretty slick though.
Sean Johnson