Streaming file uploads to S3 and GraphicsMagick

Usage no npm install needed!

<script type="module">
  import skipperS3Gm from '';


[skipper emblem - face of a ship's captain][project-root] Skipper-S3-GM


Based on SailsJS Skipper S3 adapter for receiving upstreams and orginally forked from skipper-s3-resize but with MANY EXTRA features.

  • Added GraphicsMagick CROP, RESIZE, noProfile(Remove EXIF data) option
  • Added file rename option before it is uploaded to S3
  • S3 upload addition information (region, endpoint, token, maxBytes, headers)
  • Updated all depeneded packages to the latest version


Getting started

First download and install GraphicsMagick or ImageMagick. In Mac OS X, you can simply use Homebrew and do:


apt-get install graphicsmagick


brew install graphicsmagick


First of all, make sure you have graphicmagick installed.

To install it using npm:

$ npm install skipper-s3-gm --save

Also make sure you have skipper itself installed as your body parser.


  1. In Controller:
  upload: function(req, res) {
      adapter: require('skipper-s3-gm'),
      key: <YOUR_S3_KEY>,
      secret: <YOUR_S3_SECRET>,
      bucket: <YOUR_S3_BUCKET>,
      region: <YOUR_S3_REGION_OPTIONAL>,
      endpoint: <YOUR_S3_ENDPOINT_OPTIONAL>,
      token: <YOUR_S3_TOKEN_OPTIONAL>,
      maxBytes: 1000 * 1000 * 10,   // [OPTIONAL]: S3 max upload size
      headers: {                    // [OPTIONAL]: S3 Additional Headers information
        'customkey': 'data'         
      filename: function(file) {  // [OPTIONAL]: input can be wither FUNCTION or STRING
           return file.filename + '_awesome';
      gm: {                         // [OPTIONAL]: You can skip all graphicsmagick options
        format: 'jpg',              // [OPTIONAL]: if you need to change the image format 
        noProfile: true,            // [OPTIONAL]: remove EXIF profile data (Default = false)
        crop: {                     // [OPTIONAL] Crop
          width: 200,
          height: 200,
          x: 0,
          y: 0
         resize: {                  // [OPTIONAL] Resize
          width: 200,
          height: 200,
          options: '!'              // DOC:
    }, function(err, body) {

      // If successful, will return body, containing Location, Bucket, Key, ETag and size of the object.
      // Otherwise it will return an error.
            Location: '',
            Bucket: 'Example-Bucket',
            Key: 'destination.txt',
            ETag: '"3858f62230ac3c915f300c664312c11f-9"',
            size: 7242880
      if(err) {
        return res.serverError(err);


  1. Refer skipper documentations.