LilyGo T-RGB loading jpeg

Hi,

Using LilyGo T-RGB and SquareLine Studio to design stuff and LVGL version 8.4. (that's the limit of LilyGo environment). I got design stuff done fine and I could recommend SquareLine Studio.

According to documentation LVGL8.4 supports JPG and PNG (got the same noise with PNG)

What I want to do is: load jpeg of the server and display it in imageWidget. Image is usually 640x640 (or bigger... but bigger than widget anyway)

I got image into a byte array just fine, but decoding jpeg is a bit of a problem. I usually got black image, but this code, at least, gives me color noise in the widget.

              lv_img_dsc_t img_dsc;
              img_dsc.header.always_zero = 0;
              img_dsc.header.w = 640;
              img_dsc.header.h = 480;
              img_dsc.data_size = sizeof(buffer);
              img_dsc.header.cf = LV_IMG_CF_TRUE_COLOR;
              img_dsc.data = buffer;

              lv_img_set_src(imgWidget, &img_dsc);

Also messed around with "lv_img_decoder" but I couldn't make it work ...

Anyone have any decent example?
(please don't say chatGPT)

I don't know LVGL but I think you need to decode the PNG/JPEG first.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.