configure paperclip to generate styles when they are requested - ruby-on-rails

I need a user to upload an original file and process that into a thumbnail (paperclip's got this - check).
Then I would like to be able to retrieve different styles for that attachment, but I do not need to store those different styles on disk anywhere. I would prefer they are generated during the request.
The reason for that is that these styles are single-use. So, paperclip becomes a glorified one-time-use image resiszer. I'd prefer not to incur the S3 cost if I don't have to.
Wondering if there'a way to do this out of the box. Or, maybe carrierwave supports something like this?
Thanks!

I'm pretty sure that the Refile library supports it. Refile is basically a modern version of the Carrierwave, written by the same author.
You can read more about the on-the-fly processing here:
https://github.com/refile/refile#processing

Related

File system for carrier wave

I have been looking at carrier wave for image uploading for a website I am creating. I have heard good things about carrier wave and same with paper clip.
What I can't seem to find information on is how either gem handles its file system. Do you I need to get a plugin to make a fast query-able file system? Were these gems(specifically carrier wave) desgined to handle a large amount of users posting pictures and if so how do they save the files?
One option that I will probably use is severin's answer at the very bottom of this link.
However if these gems already have a good file system implemented then there isn't a point in over complicating things, just need some input from you guys on the matter.
I used Paperclip with Rails 2 and switched to Carrierwave when migrated to Rails 3.
Both of these solutions write the files to the public folder with a similar folder structure.
Carrierwave also has another nice gem "Carrierwave direct" which allows to upload to a remote server or S3 directly from the user browser, which is nice for scaling. It is also a requirement when using Heroku which doesn't have a file system (or didn't have one available prviously)

Uploading directly to S3 and resizing the images

I'm using s3_direct_upload to directly upload images from my rails app to an S3 bucket. This is all working fine, however now I'd like to resize the images once uploaded, creating a thumbnail and various other versions.
The approach I can think of taking is using the URL that's posted back from s3_direct_upload to then create a new object in my app in the background, process using RMagick and then reupload these versions to S3. However, this approach feels like the initial upload becomes a little redundant.
Any advice on this or a better approach would be greatly appreciated.
Updated Answer
You mentioned in a comment to my original answer that you'd tried CarrierWave. But...have you tried out CarrierWaveDirect? I haven't used it myself, but it appears to perform the same S3 direct-uploading, with the familiar API of CarrierWave.
Original Deprecated Answer
You'll probably want to look into either Paperclip or Dragonfly. They each support uploading images to S3 (or other cloud storage provider), and also provide features for manipulating the images. The two solutions handle manipulations in different ways--Paperclip performs thumbnailing at upload-time, whereas Dragonfly performs thumbnailing on-the-fly--but either should meet your needs.

Parse word docs heroku/s3

I want to implement a functionality that needs to parse word docs, which will uploaded by user and stored on amazon S3. The application will be on heroku. I tried catdoc but it doesn't parse urls. Can anyone suggest tool that can be used on heroku to parse word documents?
UPDATE
I want to scan an uploaded ms-word(.doc) has particular words and tag them accordingly.
If you're just wanting to upload the word document you could take a look at something like the paperclip gem.
This would allow you to save the file on amazon S3 and simply download it, but you could also extend paperclip and run post-processing on the file. This is slightly more complicated.
Like willglynn says, it would be good to know what parsing you need to do, exactly?

Creating a table entry while using CarrierWaveDirect

Is it possible to use something like CarrierWaveDirect to upload directly to S3 and still be able to gather some data on the files being uploaded?
For instance, is it possible to change the filename, and save the size in a table before/after the upload? I don't need to do any kind of manipulation to the file either (I was reading some documentation regarding the use of Resque).
I realize that this is a very novice question but I couldn't find the answer anywhere.
After a lot of fiddling, I found out that the S3 secure upload form that the hidden field success_action_redirect returns so params on the uploaded file.

Image upload options for website users

I want to be able to provide my website users with the ability to upload a profile picture. What are my options? What is the best way to do this? I would need to be able to limit the image size, crop / resize the image so that I can display thumbnails of the image. The website is written using Ruby on Rails
In alternate plugin to manage your upload file is carrierwave
The PaperClip plugin is pretty much the new hotness (standard):
http://github.com/thoughtbot/paperclip
It supports different image processors but we use ImageScience. RMagick leaks memory
I agree with the others recommendation of Paperclip for handling any kind of upload.
However for profile pictures in particular, if you are storing your user's email addresses you might like to consider using Gravatar, as StackOverflow does, to effectively "outsource" this functionality and let your users maintain consistent avatars among all the sites they use.

Resources