scionoftech / webp-converter

[DEPRECATED] A small node.js library for converting any image to webp file format or converting webp image to any image file format.
MIT License
232 stars 44 forks source link

TypeError: callback is not a function #4

Closed brizandrew closed 8 years ago

brizandrew commented 8 years ago

When I try to run the dwebp example in your readme I get the following error:

TypeError: callback is not a function

It looks like your example is missing a parameter. The third parameter should be the options and the fourth should be the callback. Also, because your function is concatenating the parts of the query without spaces, the options parameter should have a space before and after it. I would suggest making your example the following:

//pass input_image(.webp image) path ,output_image(.jpeg,.pnp .....)
webp.dwebp("nodejs_logo.webp","nodejs_logo.jpg"," -o ",function(status)
    {
        //if conversion successfull status will be '100'
        //if conversion unsuccessfull status will be '101'
        console.log(status);
    });

I would assume the same issue applies for gwebp as well, but I have not checked it.