Lv_lib_png showing white rectangle


lv_lib_png doesn’t work on esp32

What MCU/Processor/Board and compiler are you using?

esp32/ platformio ide/ arduino

What do you experience?

when i try to show a png image it doesn’t work. it only shows a white rectangle with a “No data” text on the top left corner. I tried to Use PNG images from flash and file as instructed in the README file of the library and none of them works. the problem is only with png files because when i use a true color image it works fine.
I also Enabled the log module on LV_LOG_LEVEL_WARN level and the following lines are printed in the console:

.pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_img_cache.c@131->fnn: _lv_img_cache_open ->Image draw cannot open the image resource
.pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_draw_img.c@87->fnn: lv_draw_img ->Image draw error

also the same code works in vs simulator and the problem only occurs when I’m using esp32.

Code to reproduce

void setup()
  lv_obj_t *img = lv_img_create(lv_scr_act(), NULL);
  lv_img_set_src(img, &png_decoder_test);
void loop()

the lv_png_init() is inside the display_init() function.

Screenshot and/or video