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

original version removed still with cleanup false in configuration #134

Open ivanperalta opened 7 years ago

ivanperalta commented 7 years ago

original version removed still with cleanup false in configuration

Still when the configuration is like in the example:

cleanup: { versions: true, original: false }, the original version is removed, if I remove this cleanup element from the configuration the system keeps everything (original and versions) But it was impossible for me to keep only the original.

I'm using node 7.4.

Your environment

Steps to reproduce

I basically use a very similar code from the example provided

var clientS3Options = {
    aws: {
        path: '',
        region: 'eu-west-1',
        acl: 'public-read',
        accessKeyId: 'XXX',
        secretAccessKey: 'XXX',
        endpoint: 'https://s3-eu-west-1.amazonaws.com',
    },

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

    versions: [{
        maxWidth: 960,
        format: 'jpg',
        quality: 80
    },{
        maxWidth: 960,
        format: 'jpg',
        suffix: '@3x',
        quality: 80
    },{
        maxWidth: 640,
        format: 'jpg',
        suffix: '@2x',
        quality: 80
    },{
        maxWidth: 320,
        format: 'jpg',
        suffix: '@1x',
        quality: 80
    }]
};

Expected behaviour

I expect to keep the original version and remove the versions one from the source after upload the images to S3

Actual behaviour

the original version is removed, if I remove this cleanup element from the configuration the system keeps everything (original and versions) But it was impossible for me to keep only the original.