ruby - Rails - how to fetch images from S3, resize them and save thumbnails to S3? -
we have lot of images stored in amazon s3 bucket , need resize them. so, need grab images in bucket , 1 one resize them (according orientations). what's best way that? write ruby script or there way how it?
thanks
in past, i've used combo of aws-sdk-ruby gem , rmagick in worker class that:
- downloads original file s3 locally
- applies
auto_orient
- resizes x/y/z
- re-uploads orignal , new versions s3
you'd able queue process in background (delayed_job/sideqik/resque/etc) whenever receive future image.
here's gist.
Comments
Post a Comment