On Jan 6, 2011, at 12:26 PM, Marnen Laibow-Koser wrote:
JavaScript can *show* the preview in a nice popup or overlay, true,
but I think the issue here is how do you get the preview in the first
place.
[...]
My understanding is that the various JS preview libraries handle the
preview image generation within the library. I might be wrong,
though;
I've never done this.
JavaScript can only request an image and show it (often using some
groovy effect to make it shinier); it can't process the image data and
provide a thumbnail or something like that.
To get that, you'd need something server-side to do the heavy lifting
like Rmagick or some other image processing library, and you'd need a
controller to interpret the image request, decide if the file already
had been processed, do the processing and cache it if not, and then
serve it. Quite a bit out of the usual realm for JS, right in the zone
for Rails and one of its many add-ons.
If I were building this from scratch, I'd be looking at Paperclip,
because that has all the hooks for making thumbnails and resized
images already baked in, plus a very nice system for extending the
thumbnail process to other types of files. I've built a system that
scrapes all the text out of a PDF and saves it in a column in the
database so I can do "full text" search within PDF attachments.
Considering I built that as part of my very first paying Rails gig, I
happen to think that Paperclip is *very* accessible that way...
Walter
--
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.