Hello,
I wanted to use Jimp (which is installed with node-red-contrib-image-tools) inside function node. My usage is to get pixel array out of png image (tried to write my own png decoder, but had trouble with the compression chunks, even with zero compression ...). Unfortunately I am not able to load the image. I use this import in setup of function:
but then in code when I want to use Jimp.read() function, I get the error "TypeError: Jimp.read is not a function"
I never used the modules so maybe I made some mistake there.
Also I found someone imports Jimp through global context, but thought the module would be more appropriate.
Thanks for any response
Thank you for response. In fact I wasnt importing different version, but the same one from image-tools.
You are right, when I select output image type from image-tools node, there is the bitmap array inside of image object which I can use. I didnt find it before, I thought its only some object for the viewer node.
Thank you
When you enter jimp as a module into the function node it ends up installing jimp@latest:
Installing module: jimp, version: latest
The Jimp version in image-tools is from before they completely broke everything in v1.x
image-tools is currently getting a re-write (v3 branch on GitHub) that upgrades everything (but it is a pain since pretty much EVERYTHING changed from v0.x to v1.x)! That's why i said you are unnecessarily adding a reference.
OK,
when I opened the setup page first time and clicked on the module combo box, the jimp was already there, so I thought its the same jimp ... but idk if it installed the latest version