Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Thumbnail Version (Carrierwave)? #132

Open
kylerenke opened this issue Oct 9, 2013 · 2 comments
Open

Create Thumbnail Version (Carrierwave)? #132

kylerenke opened this issue Oct 9, 2013 · 2 comments

Comments

@kylerenke
Copy link

Is it possible to create a thumbnail version when uploading directly to s3_direct_upload? Perhaps integrating carrierwave somehow? I'm not quite sure how I would do this, however. Any ideas on how to do something like this?

version :thumb do
    process resize_to_fill: [200, 200]
  end
@weavermedia
Copy link

There's a good tutorial for post-processing via Paperclip which is similar to Carrierwave, you might be able to adapt the info. I'm currently using the Paperclip method and I'm fairly happy with it.

Files are uploaded via s3_direct_upload then the callback supplies the URL to the model which then checks if the file is an image and requires resizing. If so the Paperclip downloads the original, produces the thumbnails etc and then save them back to S3.

@designstuhl
Copy link

You might want to check out Episode #182 on rails casts pro (all vids are free now). In this episode he deals with uploading, cropping, and resizing images along with providing a preview during the process using CarrierWave.

Granted he does not use s3_direct_upload in his example, but this might give you some insight as to how you can accomplish what you are asking about.

I realize this original post is now 4 years old but it might still be useful information for others.

RailsCast Episode 182 (revised) https://www.youtube.com/watch?v=ltoPZEzmtJA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants