-
Notifications
You must be signed in to change notification settings - Fork 39
lv_utils for nodejs #38
Comments
@embeddedt has an almost ready JS based image converter. I'm not sure what is the current state of that project. |
@hlarouss Just to clarify, you are not selecting raw format for the color format, just "Binary" under output format, right? If so, unfortunately this is the one option my converter is still missing, and I haven't had the time or interest at the moment to add it, since I do not use the binary format in my projects. |
I think so yes. To be very precise, I'm using this output format: CF_INDEXED_1_BIT EDIT: Sorry just realised CF_INDEXED_1_BIT is the color format. So yes, I select binary and not C array |
Hi again, I was actually working on your project to add the binary support (happy to contribute and add it to your project if you want!) but , to test my code, I compared my generated bin file with a bin file generated using lvgl online tool (https://lvgl.io/tools/imageconverter) and they were different. I originally thought I was doing something wrong but then I tried to compare the .c files and I noticed that they were also different. Is it normal? Here is the command I'm typing: node lv_img_conv.js critair1.png -f -c CF_INDEXED_1_BIT |
I expect the indexed formats to be different, as I am not using exactly the same conversion logic that the PHP converter used. However, the resulting image should look similar when displayed by LVGL. |
Ok great, thanks for the info! In case this might interest anyone, a very quick and dirty way to add binary generation is to just add this part of code in the file "convert.ts": `
` just before this line: Add don't forget to declare fs: Cheers! |
@kisvegabor @hlarouss @Yohannfra I have finally gotten a chance to sit down and spend a couple hours adding binary support to my converter. Please note that this has had very limited testing (just one image being compared against the PHP converter's output). I am sure there are some corner cases/combinations I have not tried. However, it does seem to work, and this should bring the JS converter to 100% feature parity with the PHP one. I do also need to clean up the code at some point, as it's currently a mixture of manually-transpiled PHP and more idiomatic JavaScript/TypeScript patterns. https://embeddedt.github.io/lv_img_conv/ @hlarouss I have also added a note on the README of my repository of how to convert binary files using the CLI. Hopefully this works well enough for your project. |
Thanks you very much for taking the time to finish the converter. |
@embeddedt What do you think about using it on lvgl.io? We can announce that we have replaced the image converter and ask for feedback. Can we host it the lvgl organization by forking your version to keep the attribution to you? |
Sounds good to me.
Sure, that's fine, although I wouldn't be opposed to moving the repository to the organization and adding an attribution note in the README, just to simplify things. |
I'm fine with both. I leave it to you to do as you find it the best 🙂 |
Okay; I've moved it to https://github.com/lvgl/lv_img_conv. |
Hmmm... it looks like it was not bundled. Did you add it the same way as the new font converter? |
Oh, I didn't know that it works the same way. I've just copied content.html into the into the appropriate html file on our server, and index.js next to the other js files. Now I tried
|
Hmm... interestingly, I didn't get that error before, however, I have switched to nvm as well since I started working on this project, and I do get that error when I get rid of It seems that you now need to install the required native dependencies. I've added a note about this to the README. On Ubuntu:
|
Hmm... it should be working exactly the same way as the font converter, as I based the entire structure/bundler configuration on it. JQuery is supposed to be included here.
|
It works better if I use See https://lvgl.io/tools/imageconverter_new However, the bytes of the pixels are missing from the generated image. See |
This should be fixed now. I left some debug code in by accident. |
Thanks, it's working now: https://lvgl.io/tools/imageconverter_new Can I simply "include" |
You should be able to include it in the same manner as the font converter. I'm still unsure as to why it was giving you issues before. As far as I know I didn't change anything relating to JQuery or the bundling. |
I included Now it's working. Lets test it for a couple of days and then I think we can publish it. What do you think? |
Sounds good to me. |
Hello everyone,
I'm working on a personal iot project where I have objects connecting to a server (stack running on symfony) to download an image and display it on a screen. For the moment, each object downloads directly the image as a bin array. That bin array is generated directly from the server. To perform the conversion, I'm using the lv_utils library that you provide.
I'm in the process of moving my stack to aws using serverless (with lambda) in javascript (nodejs). Is there any chance that this library is available in nodejs or could I find an equivalent library somewhere?
Thanks in advance for your help,
Hous
The text was updated successfully, but these errors were encountered: