0

Has anyone made a sails app with skipper-s3 and image manipulation library to upload different sizes of images ?

For example if a user upload a user profile image then there will be three different sizes of images will be uploaded to the S3 server. Any help would be much appreciated.

Cheers.

Andre Frexio
  • 155
  • 1
  • 10
  • I use a combination of filepicker.io with blitline.com to handle that. Not exactly and answer to your question, but might be helpful. – Meeker Oct 27 '14 at 17:33
  • You can use a custom receiver with graphicsmagick as found [here](http://stackoverflow.com/questions/24069203/skipper-in-sailsjs-beta-image-resize-before-upload) – caseyWebb Dec 05 '14 at 18:36

1 Answers1

0

You can use ImageMagick-Native to do the resizing before uploadng to S3, like this:

var resBuff = imagemagick.convert({
   srcData: originalBuffer,
   width: X, //dimensions in pixel
   height: Y,
   resizeStyle: "aspectfill",
   quality: 80,
   format: 'JPEG'
});

The resBuff object can now be uploaded to s3 as the resized image.

amarprabhu
  • 350
  • 3
  • 10