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

It doesn't return or upload original image #138

Open ghost opened 6 years ago

ghost commented 6 years ago

Subject of the issue

I run the example provided in the documentation, urls of resized images is returned but original image url is never returned. Along with resize images urls i get the error: InvalidArgument, statusCode: 400

Your environment

Steps to reproduce

var client = new Upload('mybucket', {
            aws: {
                path: 'images/',
                region: 'us-west-2',
                acl: 'public-read',
                accessKeyId: '******************',
                secretAccessKey: '**********************',
                maxRetries: 5,
                retryDelayOptions: 2000,
                httpOptions: {
                    timeout: 240000
                }
            },
            returnExif: true,
            cleanup: {
                versions: true,
                original: false
            },

            original: {
                awsImageAcl: 'public'
            },

            versions: [
                {
                    maxWidth: 200,
                    maxHeight: 200,
                    aspect: '1:1',
                    format: extension.replace('.', ''),
                    suffix: '-small'
                },{
                    maxHeight: 45,
                    maxWidth: 45,
                    aspect: '1:1',
                    format: extension.replace('.', ''),
                    suffix: '-thumb'
                }
            ]
        });

        client.upload(req.files[0].path , {}, function(err, versions, meta) {
            if (err) { throw err; }

            versions.forEach(function(image) {
                console.log(image.width, image.height, image.url);

            });
        });

Expected behaviour

It should return thumbnails as well as original image url

Actual behaviour

it only returns thumbnails and throws exception


// log outoput or error messages here
{ InvalidArgument: null
  message: null,
  code: 'InvalidArgument',
  region: null,
  time: 2017-10-08T12:10:37.458Z,
  requestId: '9B47F8890644E9DF',
  extendedRequestId: 'dxCsc0/Uac6bhLgVwxKlB8r6TWSTb0v8ymxaDs5YFre76jAdbY1Pc6tPWf31pYQAqtn93QjSNT8=',
  cfId: undefined,
  statusCode: 400,
  retryable: false,
  retryDelay: 23.631394362974078 }