Turistforeningen / node-s3-uploader

Flexible and efficient resize, rename, and upload images to Amazon S3 disk storage. Uses the official AWS Node SDK for transfer, and ImageMagick for image processing. Support for multiple image versions targets.
https://www.npmjs.com/package/s3-uploader
MIT License
241 stars 54 forks source link

upload error: convert failed #137

Open haseebnaseem opened 7 years ago

haseebnaseem commented 7 years ago

Subject of the issue

Unable to run the code given in the documentation.

Your environment

Steps to reproduce

Tell us how to reproduce this issue. Please provide a minimal code example to demonstrate the problem.

var client = new Upload('my_s3_bucket', {
  aws: {
    path: 'images/',
    region: 'us-east-1',
    acl: 'public-read'
  },

  cleanup: {
    versions: true,
    original: false
  },

  original: {
    awsImageAcl: 'private'
  },

  versions: [{
    maxHeight: 1040,
    maxWidth: 1040,
    format: 'jpg',
    suffix: '-large',
    quality: 80,
    awsImageExpires: 31536000,
    awsImageMaxAge: 31536000
  },{
    maxWidth: 780,
    aspect: '3:2!h',
    suffix: '-medium'
  },{
    maxWidth: 320,
    aspect: '16:9!h',
    suffix: '-small'
  },{
    maxHeight: 100,
    aspect: '1:1',
    format: 'png',
    suffix: '-thumb1'
  },{
    maxHeight: 250,
    maxWidth: 250,
    aspect: '1:1',
    suffix: '-thumb2'
  }]
});

client.upload('1.jpg', {}, function(err, versions, meta) {
  if (err) { throw err; }
  versions.forEach(function(image) {
    console.log(image.width, image.height, image.url);
  });
});

Expected behaviour

The image should be uploaded.

Actual behaviour

client.upload throws an error

{ Error: Command failed: convert 1.jpg -auto-orient -strip -write mpr:1.jpg +delete
convert: missing an image filename `+delete' @ error/convert.c/ConvertImageCommand/3212.

    at ChildProcess.exithandler (child_process.js:205:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at Pipe._handle.close [as _onclose] (net.js:511:12)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'convert 1.jpg -auto-orient -strip -write mpr:1.jpg +delete' }