Mike
Mike

Reputation: 9842

Resizing images on Amazon S3 from Heroku

The Rails app requires greyscale, thumbnail copies of the images. So I'm thinking about writing a rake task within the Rails app to produce the copies.

My questions are:

  1. Is Imagemagick available and supported on Heroku?
  2. If so, is there any documentation on how to use Imagemagick on Heroku?
  3. If so, do I have to pull down the file from S3 to a tmp directory, make the copy then upload back to S3?
  4. If so, would I incur Amazon S3 data transfer fees?

    or...

  5. Is there a better way? :)

Thanks!

Upvotes: 2

Views: 2162

Answers (2)

hgmnz
hgmnz

Reputation: 13306

  1. Yes
  2. It's standard imagemagick, the imagemagick docs should suffice.
  3. Yes, that would be the way to do it. You download an image, process it, and ship it back to S3. Once your process exits, the local files will simply disappear.
  4. No

...

  1. I don't think so :)

Upvotes: 2

Leo Correa
Leo Correa

Reputation: 19789

You could take a look at Magickly if you already have the link to the image itself. I'm not sure, however, if there are fees for data transfer on that end. You could always use CarrierWave to handle your uploads to S3 as well as resizing and image processing.

EDIT I looked at your question again and I saw that you already have a lot of JPEGs in your bucket so I think what you are looking for is the first one. You could use Magickly or use background workers to process the resizing locally. Either way, depending on how to choose to go about it, you will have to get the image itself, unless, you have a direct link to the image.

Upvotes: 1

Related Questions