ddo / node-resemble

Image analysis and comparison with HTML5
MIT License
20 stars 10 forks source link

resemble outputSettings aren't exposed #7

Open manthey opened 7 years ago

manthey commented 7 years ago

Because resemble is wrapped as a function, you can't reach the outputSettings method. The export could be changed like so:

module.exports = (function() {
    if (typeof window === "undefined") {
        global.window = overrideWindow()
    }
    if (typeof FileReader === "undefined") {
        global.FileReader = overrideFileReader()
    }
    if (typeof Image === "undefined") {
        global.Image = overrideImage()
    }
    const resemblejs = require('resemblejs');
    return resemblejs;
})();

So that the actual resemblejs import is returned, in which case it would still have the outputSettings method.

ddo commented 7 years ago

ty I gonna check this on weekend