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

client.upload() getting error #133

Open sanjeevbelagali opened 7 years ago

sanjeevbelagali commented 7 years ago

Subject of the issue

I am unable to run the code

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('bucket name', {
              aws: {
                path: 'images/',
                region: 'us-east-1',
                acl: 'public-read',
                accessKeyId: keyId,
                secretAccessKey: secretKey,
              },

              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'
              },{
                maxHeight: 100,
                aspect: '1:1',
                format: 'png',
                suffix: '-thumb1'
              },{
                maxHeight: 250,
                maxWidth: 250,
                aspect: '1:1',
                suffix: '-thumb2'
              }]
            });
            client.upload('img.jpg', {}, function(err, versions, meta) {
              if (err) { 
              console.log(err); }

               versions.forEach(function(image) {
                 console.log(image.width, image.height, image.url);
                // 1024 760 https://my-bucket.s3.amazonaws.com/path/110ec58a-a0f2-4ac4-8393-c866d813b8d1.jpg
              });
            });

Expected behaviour

Tell us what should happen.


{ [Error: Command failed: C:\Windows\system32\cmd.exe /s /c "convert img.jpg -auto-orient -s                                                                                                    trip -write mpr:img.jpg +delete mpr:img.jpg -quality 80 -resize "1040x1040" -write img-large                                                                                                    .jpg +delete mpr:img.jpg -quality 70 -crop "NaNxNaN+NaN+NaN" -resize "780" -write img-medium                                                                                                    .jpg +delete mpr:img.jpg -quality 70 -crop "NaNxNaN+NaN+NaN" -resize "x100" -write img-thumb                                                                                                    1.png +delete mpr:img.jpg -quality 70 -crop "NaNxNaN+NaN+NaN" -resize "250x250" img-thumb2.j                                                                                                    pg"
convert.exe: invalid argument for option `-crop': NaNxNaN+NaN+NaN @ error/convert.c/ConvertI                                                                                                    mageCommand/1176.
]
  killed: false,
  code: 1,
  signal: null,
  cmd: 'C:\\Windows\\system32\\cmd.exe /s /c "convert img.jpg -auto-orient -strip -write mpr                                                                                                    :img.jpg +delete mpr:img.jpg -quality 80 -resize "1040x1040" -write img-large.jpg +delete mp                                                                                                    r:img.jpg -quality 70 -crop "NaNxNaN+NaN+NaN" -resize "780" -write img-medium.jpg +delete mp                                                                                                    r:img.jpg -quality 70 -crop "NaNxNaN+NaN+NaN" -resize "x100" -write img-thumb1.png +delete m                                                                                                    pr:img.jpg -quality 70 -crop "NaNxNaN+NaN+NaN" -resize "250x250" img-thumb2.jpg"' }