Example of LVGL 9 image header

Is there anyone that has a working copy of an image file? Just, working, and working on LVGL 9, any of the LVGL 9, I will amend my code to match whatever working header I can get a copy of.
I am running the Platformio extension in VS code. My Ini file includes LVGL 9.3 as well as a bunch of other envrionmentals that I am getting REALLY close to getting FastLED working in parallel to my 1.69 touch display (ESP32-S3) from waveshare. I even have a working main cpp file, all I want is to be able to take the png file I ran through the converter and add it to my project. I just need to know what, specifically I need in the header of that pic.c file. Any examples would be greatly appreciated.
Again, preferably the V9, I have a feeling, especially with regards to the color flags If I move to another version I am going to have to redo everything I have done with the FastLed setup. Im on day 7 with no good plan moving forward.

Hello,
If you have the png files, you can convert them using the online tool

Refer to this sample in LVGL v9

I can’t get a single version to work from their online converter. I have been at this for 3 solid weeks. I have tried every single example documentation. WIth headers, adjusting headers, it doesn’t matter, I get an error every time.

For reference i get the following errors:
/workspace/apps/template/main/Akame.c:308:3: error: expected primary-expression before ‘.’ token
308 | .header.cf = LV_COLOR_FORMAT_RGB565,
| ^
/workspace/apps/template/main/Akame.c:309:3: error: expected primary-expression before ‘.’ token
309 | .header.magic = LV_IMAGE_HEADER_MAGIC,
| ^
/workspace/apps/template/main/Akame.c:310:3: error: expected primary-expression before ‘.’ token
310 | .header.w = 240,
| ^
/workspace/apps/template/main/Akame.c:311:3: error: expected primary-expression before ‘.’ token
311 | .header.h = 280,
| ^
/workspace/apps/template/main/Akame.c:312:3: error: either all initializer clauses should be designated or none of them should be
312 | .data_size = 67200 * 2,
| ^
I get them no matter which color selection I make. Same result, tried removing the forward information going with the VScode selection of just the numbers and that “worked” but it never showed up as an image

Hi

That seems to be an issue with the compiler, assuming you are using LVGL 9 and C compiler, that should be valid.

This Using images in LVGL, getting “error: expected primary-expression before ‘.’ token” - My projects - LVGL Forum points that could be something related to using a C++ compiler instead of C compiler for the image file.

You can try what is suggested in the thread, to change the order of the fields in the initialization structure, not sure if it will solve, but seems to be some issue with c++ compilers.

An image with:

const lv_image_dsc_t img_test1 = {
  .header.cf = LV_COLOR_FORMAT_RGB565,
  .header.magic = LV_IMAGE_HEADER_MAGIC,
  .header.w = 82,
  .header.h = 82,
  .data_size = 6724 * 2,
  .data = img_test1_map,
};

Is successfully compiled with a C compiler (either on PC, STM32 with GCC, or ESP-IDF).

Thank you so much. I’ll try that when I get home from work today.

If it’s something related to the “fileds” order, you can try the python image converter (lvgl/scripts/LVGLImage.py at master · lvgl/lvgl · GitHub)

You need some extra stuff installed (at least pypng and lz4) for the script to work, but it generates the header in correct “order” and supports more image formats than the web converter.