Sorry, I remembered the wrong version. I am using the simulated development environment of v7.10.1 version to test and open the jpg file. Here is the printed log. It shows that the memory cannot be allocated. The memory size I configured in config.h is 1 * 1024 * 1024. This is very strange.
User: LV_FS_PC is initialized with. (lv_fs_pc.c #115 lv_fs_if_pc_init())
User: The following path is considered as root directory:
/home/server/lv_sim_vscode_sdl (lv_fs_pc.c #116 lv_fs_if_pc_init())
Warn: Couldn't allocate memory (lv_mem.c #198 lv_mem_alloc())
Warn: Image draw cannot open the image resource (lv_img_cache.c #135 _lv_img_cache_open())
Warn: Image draw error (lv_draw_img.c #88 lv_draw_img())
Warn: Couldn't allocate memory (lv_mem.c #198 lv_mem_alloc())
Warn: Image draw cannot open the image resource (lv_img_cache.c #135 _lv_img_cache_open())
Warn: Image draw error (lv_draw_img.c #88 lv_draw_img())
Warn: Couldn't allocate memory (lv_mem.c #198 lv_mem_alloc())
Warn: Image draw cannot open the image resource (lv_img_cache.c #135 _lv_img_cache_open())
Warn: Image draw error (lv_draw_img.c #88 lv_draw_img())
When decoding JPEG files, the SJPG decoder has to store the entire uncompressed image in RAM. At 16-bit color, that’s 614KB. If there is additional overhead for the decompression, it’s possible that the total allocation exceeds 1MB.
Try with a bigger heap (e.g. 2MB) and see if it works.
I set the LV MEM_SIZE in lv_conf.h to 2M or greater, it still shows No Data, and the log still prints: Warn: Couldn't allocate memory (lv_mem.c #198 lv_mem_alloc())
I located the place where the memory application failed. On line 668 of lv_sjpg.c sjpeg->frame_cache applied for a memory size of640 * 480 * 3bytes. In fact, the heap size I configured in lv_conf.h is 12M. This makes me very confused. Does lvgl have any other restrictions on each memory application?
Sorry, I have found the reason. The heap size set by my simulation project does not work. As a result, it is impossible to apply for a space larger than 200kb. thank you very much for your help.