Comments (11)
My educated guess would be that you are running out of heap space.
from lv_lib_png.
My educated guess would be that you are running out of heap space.
I don't think that's the case here, because esp32 has 294k free heap before trying to show the image while the image size is only 20k.
from lv_lib_png.
What is the resolution of the image?
It needs minimum hor. res. x ver. res. x 4 bytes
from lv_lib_png.
What is the resolution of the image?
It needs minimum
hor. res. x ver. res. x 4 bytes
I'm using the image that came with the library (png_decoder_test.c) which is 200 x 150 and it needs 200 x 150 x 4=120kB which is about 1/3 of esp's free heap (294kB) in this project.
from lv_lib_png.
Do you see anything suspicious if you enable logging in lv_conf.h?
from lv_lib_png.
Do you see anything suspicious if you enable logging in lv_conf.h?
I can't figure out the problem from the logs so I just post them here.
there's no log on LV_LOG_LEVEL_ERROR.
here's the log on LV_LOG_LEVEL_WARN:
.pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_img_cache.c@135->fnn: _lv_img_cache_open ->Image draw cannot open the image resource .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_draw_img.c@88->fnn: lv_draw_img ->Image draw error .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_img_cache.c@135->fnn: _lv_img_cache_open ->Image draw cannot open the image resource .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_draw_img.c@88->fnn: lv_draw_img ->Image draw error .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_img_cache.c@135->fnn: _lv_img_cache_open ->Image draw cannot open the image resource .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_draw_img.c@88->fnn: lv_draw_img ->Image draw error .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_img_cache.c@135->fnn: _lv_img_cache_open ->Image draw cannot open the image resource .pio\libdeps\esp32dev\lvgl\src\lv_draw\lv_draw_img.c@88->fnn: lv_draw_img ->Image draw error
and here's the pastebin link for the log on LV_LOG_LEVEL_INFO.
from lv_lib_png.
Have you called lv_png_init()
?
from lv_lib_png.
Have you called
lv_png_init()
?
Yes, I've called it right after calling lv_init()
.
from lv_lib_png.
I've tested it on PC and worked well for me.
I suggest debugging the devoder_open()
function to see why it can't open the imaga.
from lv_lib_png.
I suggest debugging the
devoder_open()
function to see why it can't open the imaga.
I did it and function lodepng_decode32()
which is called inside decoder_open()
returns error 83 which means "memory allocation failed".
I used smaller pictures and it worked fine with a 150x100 png c array, but fails with a 200x100 one.
It's still confusing since esp32 has about 300kB free ram available and a 200x100 png c array needs only ~80kB of ram.
from lv_lib_png.
It's more than 80kB because the one decoder uses some internal working buffers too, but it shouldn't be an extra 220 kB.
Maybe it's somehow specific to ESP32 memory manager.
You can try to change lodepng's malloc/free to lv_mem_alloc/realloc/free and give areally large LV_MEM_SIZE to LVGL.
from lv_lib_png.
Related Issues (20)
- Problem when using canvas on top of png HOT 4
- Some problems with imgbtn HOT 2
- bug with LODEPNG_COMPILE_ALLOCATORS option HOT 6
- how to enhance decoder's performance ? HOT 2
- PNG test on lv_port_stm32f429_disco HOT 9
- PNG photo 8 bitcolor someting wrong HOT 2
- memory allocation failed HOT 15
- png image not displayed properly HOT 3
- error: conflicting types for 'decoder_info' HOT 10
- invalid ADLER32 while drawing image HOT 13
- image with alpha channel is broken HOT 12
- 'LV_PNG_USE_LV_FILESYSTEM' is never used? HOT 9
- Png picture distortion HOT 5
- free memory HOT 6
- How to enable key color when displaying PNG HOT 4
- how to make the background of image button to be transparent? HOT 2
- can't display the png img in vs2019 simulator HOT 2
- Does APNG support? HOT 4
- Load PNG from variable HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lv_lib_png.