1

Basically, I want to import a number of URL of pictures from around the web and manage them in my app. I also let the user upload some files, and I use paperclip to manage the upload and generate thumbnails.

My question is: can I use paperclip just to generate (and store) thumbnails for pictures whose originals are stored elsewhere (flickr, picasa, wherever)?

If this isn't possible at all, what would be a good alternative?

joao
  • 3,517
  • 1
  • 31
  • 43

1 Answers1

2

I don't believe paperclip offers this functionality however carrierwave is a good alternative which does.

To scale the original image, ie. not store two sizes you can do this:

process :resize_to_limit => [400, 400]  

Storing the original url would be quite simple by adding a field to the model with the uploader.

mark
  • 10,316
  • 6
  • 37
  • 58
  • Great! Quite easy to setup, but downloads the image as well. I would rather it would download the image, generate the thumb, but then store the original URL and delete the downloaded file. Maybe some modifications to carrierwave are in order, will have a look at it... – joao Jul 14 '11 at 13:21
  • Hey, getting closer :-D! The thing is I'm using a form input tag with attribute name `remote_media_url`, and then I use `@asset.update_attributes` which magically works with carrierwave's `mount_uploader :media`. Unfortunately the attribute is then "discarded", even if I have an explicit `remote_media_url` field of type string in my assets table. I guess I could code some model-specific logic into the `assets_controller` to change its name, but there must be some cleaner way... Sorry I'm quite a newb – joao Jul 14 '11 at 16:02