w3nl / ppt-png

Convert ppt to png
MIT License
45 stars 7 forks source link

Error only collected when logLevel >= 1 #24

Closed adrianhelvik closed 4 years ago

adrianhelvik commented 4 years ago

I had a look through the code and found this. Shouldn't this.failed.push occur regardless of the log level?

    processPage(file, error, image) {
        if (error) {
            if (this.logLevel >= 1) {
                console.error('Inverting page error', error);
                this.failed.push({
                    file:    this.currentFile,
                    failure: 'jimp',
                    error:   error
                });
            }

            return;
        }

        if (this.greyscale) {
            image.greyscale();
        }

        if (this.invert) {
            image.invert();
        }

        image.write(file);
    }
w3nl commented 4 years ago

Thanks for the feedback, it should indeed add it to failed, and shouldnt check the logLevel