kevva / to-ico

Convert PNG to ICO in memory
MIT License
137 stars 19 forks source link

TypeError when calling 'toIco()' #18

Closed GarkGarcia closed 5 years ago

GarkGarcia commented 5 years ago

I'm getting the following error when calling toIco(arr: string[])...

TypeError: Expected a buffer
    at module.exports (path\node_modules\parse-png\index.js:6:25)
    at Promise.all.data.map.x (path\node_modules\to-ico\index.js:90:35)
    at Array.map (<anonymous>)
    at generateIco (path\node_modules\to-ico\index.js:90:26)
    at module.exports (path\node_modules\to-ico\index.js:146:9)

Am I doing something wrong?

GarkGarcia commented 5 years ago

I figured it out. The problem is toIco() takes a Buffer[] as an argument, but the documentation says it takes a string[]:

toIco(input, [options])

input Type: Array string

I believe the docs should say something like the following:

toIco(input, [options])

input Type: Array<Buffer>