Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't show Image with jpg format. #285

Open
HonestQiao opened this issue Jun 28, 2023 · 3 comments
Open

Can't show Image with jpg format. #285

HonestQiao opened this issue Jun 28, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@HonestQiao
Copy link

HonestQiao commented Jun 28, 2023

My device: ESP32-S3-Box-Lite (N16R8V) + Display: ST7789
MycroPython: MicroPython v1.20.0-698-g3f25a765d on 2023-06-28; ESP32S3 Box Lite (spiram octal) with ESP32S3

My code:

import lvgl as lv
import lv_utils
import fs_driver

lv.init()
fs_drv = lv.fs_drv_t()
fs_driver.fs_register(fs_drv, 'S')

/* config for display */

scr = lv.scr_act()
cover_img = lv.img(scr)
cover_img.set_src("S:/images/zt_cover.png")
cover_img.set_size(180, 240)
cover_img.align(lv.ALIGN.TOP_LEFT, 0, 0)

If I use "S:/images/zt_cover.png" for cover_img.set_src(), the image will be displayed.
zt_cover.png

If I use "S:/images/zt_cover.jpg" for cover_img.set_src(), the image wont be displayed. No error, only empty.
zt_cover.jpg is convert from zt_cover.png.
zt_cover.jpg

I tried to use ./lib/lv_bindings/lvgl/scripts/jpg_to_sjpg.py to convert zt_cover.jpg to zt_cover.sjpg, but zt_cover.sjpg can't be displayed either.

In ./lib/lv_bindings/lv_conf.h, LV_USE_SJPG is open:

/*PNG decoder library*/
#define LV_USE_PNG 1

/*BMP decoder library*/
#define LV_USE_BMP 1

/* JPG + split JPG decoder library.
 * Split JPG is a custom format optimized for embedded systems. */
#define LV_USE_SJPG 1

/*GIF decoder library*/
#define LV_USE_GIF 1

What is the problem?

@amirgon
Copy link
Collaborator

amirgon commented Aug 3, 2023

I'm not sure it's related but ESP32S3 is not officially supported by lv_micropython.
Did you try to reproduce this problem in C? It's not clear to me if it's Micropython bindings issue of LVGL issue

@PGNetHun
Copy link
Collaborator

Hello!
There is a bug in LVGL lv_sjpg.c file, the problem is the color format:
lvgl/lvgl#4407 (comment)

@PGNetHun
Copy link
Collaborator

@amirgon ,
The JPEG color format issue will be fixed by PR lvgl/lvgl#4473
But please do not update LVGL library in binding yet, as there is another bug in JPEG rendering: lvgl/lvgl#4407 (comment)

the call to JPEG decoder is removed in the parallel rendering architecture commit:
lvgl/lvgl@f753265#diff-90f14ebcd1b2e071c69ef3ad4020cb675f2484b26db670b0e455b1aec6cabdb0L78

@PGNetHun PGNetHun added the bug Something isn't working label Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants