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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -