lokesh / color-thief

Grab the color palette from an image using just Javascript. Works in the browser and in Node.
https://lokeshdhakar.com/projects/color-thief/
MIT License
12.49k stars 1.31k forks source link

"Uncaught ReferenceError: i is not defined at n.onload" when calling getImageData #221

Open jcgjunge opened 2 years ago

jcgjunge commented 2 years ago

There seems to be an error in the function getImageData.

The line "i = uInt8Array.length;" is giving the error "Uncaught ReferenceError: i is not defined at n.onload". Since it does not really do anything the line should be deleted.

https://github.com/lokesh/color-thief/blob/ef231c711309dc32be1efa83bd4da7c0ed21cd6e/src/color-thief.js#L120