Use lv_lib_pn-8.0.2 show png image error, it shows no data

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Be sure you have checked the FAQ and read the relevant part of the documentation.
  • If applicable use the Simulator to eliminate hardware related issues.

Delete this section if you read and applied the mentioned points.


I add the lv_lib_png to my project, and init the file system throw the lv_port_fs_template.c, I filled the fs_open/fs_seek/fs_close/fs_read, and I init the lv_port_fs_init() and lv_png_init,then test the png_decoder_test.png, it shows no data, the png info seems get ok, but it shows error.

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

arm335x, Linux, use standard IO interface.

What LVGL version are you using?


What do you want to achieve?

What have you tried so far?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:


  //this one shows OK
    lv_obj_t* img_1 = lv_img_create(lv_scr_act());
    lv_img_set_src(img_1, &png_decoder_test);
    lv_obj_align(img_1, LV_ALIGN_BOTTOM_MID, 0, 0);

  //this one shows error
//    LV_IMG_DECLARE(png_decoder_test);
    lv_obj_t* img_2 = lv_img_create(lv_scr_act());
    lv_img_set_src(img_2, "L:/run/storage/mmcblk0p3/png_decoder_test.png");
    lv_obj_align(img_2, LV_ALIGN_CENTER, 0, 0);

Screenshot and/or video

this problem solved, for the reason I forgot fill the fs_tell interface.

1 Like