Closed ianwijma closed 2 years ago
It looks like you aren't decoding the ong file to a pixel buffer before passing it into fillKeyBuffer. If you use pngjs or canvas or something to convert the image first, that should fix your issue
Awesome, thanks allot! I found out that the library that I use Jimp
has the pixel buffer available, so I could use that.
Yes jimp also works well. There is an example using that too https://github.com/Julusian/node-elgato-stream-deck/blob/master/packages/node/examples/fill-button-when-pressed-jimp.js
OMG, yes! I some how missed that folder with examples! Thanks lots again for the awesome lib! :D
Thanks for the great project!
I'm bumping into some issues with regards of images within node, which I might be the one to blame for as I might miss something. It's with regard of writing an image to a key.
I have a solid coloured test image, which dimensions matches the
ICON_SIZE
constant, which is 96x96.I wrote a small test script that reads that image, and sends it off to the device to display it:
But when I run this fairly simple script I get the following error:
I understand why this error happens, because the image is tiny. But the image is still 96x96.
After checking out the webhid demo project I decided to make another small script that uses canvas in node to create the image, but I get similar results.
I had similar issues with the fillPanelBuffer method, where I took a screenshot using puppeteer:
But this resulted into a similar error:
Dumping this image does result into a image with correct dimensions:
It could be that I miss some parsing of the image buffer, but I can't seem to find what's wrong.