Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Lv_lib_png showing white rectangle #7

@matinrn

Description

@matinrn

Hello
I'm using esp32(arduino framework) + lvgl + lv_lib_lodepng.
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() { display_init(); touch_init(); lv_fs_if_init(); LV_IMG_DECLARE(png_decoder_test); lv_obj_t *img = lv_img_create(lv_scr_act(), NULL); lv_img_set_src(img, &png_decoder_test); } void loop() { lv_task_handler(); delay(5); }
the lv_png_init() is inside the display_init() function.
Screenshot and/or video
2f7e7d4ebaea75d69a2f2a12e2ebfcc70f1ad4bb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions