Open WiktorBAbove opened 3 years ago
Probably you are out of memory.
I've added a smaller png_decoder_test
image. Does it work with that?
That worked well!
I have tried to convert myown png to 50x50 like png_decoder_test
.
const lv_img_dsc_t png_decoder_test = {
.header.always_zero = 0,
.header.w = 50,
.header.h = 50,
.data_size = 5158,
.header.cf = LV_IMG_CF_RAW_ALPHA,
.data = png_decoder_test_map,
};
and mine is:
const lv_img_dsc_t testtubeslab2 = {
.header.always_zero = 0,
.header.w = 50,
.header.h = 50,
.data_size = 3727,
.header.cf = LV_IMG_CF_RAW_ALPHA,
.data = testtubeslab2_map,
};
It is smaller in size however it is showing just a bold text PNG
on the screen.
I converted it by:
php ../lv_utils/img_conv_core.php "name=testtubeslab2&img=./png/testtubeslab2.png&format=c_array&cf=raw_alpha"
I am using php7.4-gd
and php7.4-cli
if that matters?
Am i missing something crucial for it to work?
Could you send the PNG image you used?
I think i figured out what was wrong!
Both files can be opened and viewed. However the current decoder cant handle an image that is resized with Imagick.
convert orig.png -resize 50x50 resized.png
Now I've actually managed to combine, a transparent PNG together with a 320x240 transparent GIF animation, without graphical issues.
I suppose we can close this issue, thank you for quick response! and your work!
I'd be curious to know if the same issue happens when converting the PNG to LVGL format using the experimental JS converter. There are many variants of PNG and the PHP converter tends to fail on several of them.
@embeddedt: Since you mentioned it, I have done the same test, but with the experimental "JS converter". It seems to work even though i converted it with Imagick with some extra bytes. What is missing is the correct image-description of size,h and w in the generated C-file which I needed to update, or else "no bueno" Other than that; maybe a 80char width would be more estethicaly appealing.
What is missing is the correct image-description of size,h and w in the generated C-file which I needed to update, or else "no bueno"
Are you referring to the struct generated at the end of the file? That is using the dimension data provided by the browser, which should match the dimensions of the PNG file. If it's not matching, please provide the PNG file so I have something to replicate the issue with.
So i tried: https://blog.lvgl.io/assets/png_converter/png_decoder_test.png All color formats give good dimensions, except all the RAW color formats selections where the dimensions have been zeroed out also the datasize. The experimental one puts just zeroes on :
.header.w = 0,
.header.h = 0,
.data_size = 0,
Note: the current image converter doesnt add the zeroes for the dimension but gives good .data_size
on all RAW color formats.
Dimensions being 0 are intended, as the RAW feature actually allows you to convert any type of file. For a PNG image, the PNG decoder will take care of finding the width and height from the PNG data at runtime. I don't think you're supposed to have to add them by hand - @kisvegabor is this a bug in the PHP converter?
Data size being 0 is a bug on mine which should be fixed now. I also added line breaks for RAW images as it's easier to do there.
Hello Im trying to load the basic example on a stm32f429 discovery board. Im not doing anything unusual,
The only thing I get on the screen is:
I just have one image, but I've #define LV_IMG_CACHE_DEF_SIZE 2 Is there anything else I need to think about? Im using "7faf20592598e7f891cf2aceca32bbe6ff5fc36c"