Skip to content

juresyahya/skipper-s3-resize

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

skipper-s3-resize

Based on SailsJS Skipper S3 adapter for receiving upstreams with a twist: Images will be resized before uploading using GraphicMagick.

Installation

First of all, make sure you have graphicmagick installed.

To install it using npm:

$ npm install skipper-s3-resize --save

Also make sure you have skipper itself installed as your body parser. This is the default configuration in Sails as of v0.10.

Usage

  1. In Controller:
  upload: function(req, res) {
    req.file('image').upload({
      adapter: require('skipper-s3-resize'),
      key: <YOUR_S3_KEY>,
      secret: <YOUR_S3_SECRET>,
      bucket: <YOUR_S3_BUCKET>,
      resize: {
        width: <WIDTH>,
        height: <HEIGHT>,
        options: <GRAPHICMAGICK_OPTIONS>
      }
    }, function(err, uploadedFiles) {
      if(err) return res.serverError(err);
        res.ok();
      });
    }

Options

  1. Refer skipper documentations.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%