Giter VIP home page Giter VIP logo

Comments (10)

liamHowatt avatar liamHowatt commented on September 23, 2024

Hey, thanks. Indeed the v9 tool doesn't work. The docs still link to the v8 converter but the output is not compatible with v9 LVGL. We'll keep this issue open until it's corrected.

Until then, 2 thing worked for me.

1.

Use the v8 converter and then edit the lv_img_dsc_t at the bottom of the output.

E.g. change this output from the v8 converter...

const lv_img_dsc_t bulb = {
  .header.cf = LV_IMG_CF_RAW_CHROMA_KEYED,
  .header.always_zero = 0,
  .header.reserved = 0,
  .header.w = 60,
  .header.h = 80,
  .data_size = 17693,
  .data = bulb_map,
};

...to this v9 compatible one...

const lv_img_dsc_t bulb = {
  .header.cf = LV_COLOR_FORMAT_RAW,
  .header.w = 60,
  .header.h = 80,
  .data_size = 17693,
  .data = bulb_map,
};

2.

Or you can use the python tool. It worked for me.

python  scripts/LVGLImage.py  --ofmt C  --cf RAW  -o your_output_dir_path   examples/libs/gif/bulb.gif

from lvgl.

hoanglam9925 avatar hoanglam9925 commented on September 23, 2024

The first method worked for me, but it only worked with images smaller than 140 x 140. When I tried to use a file 150 x 150, there were some issues; in the log, it simply said "Couldn't load the source" for images larger than this. Even after raising LV_MEM_SIZE to 128 * 1024, it is still not functioning. How to play a larger-sized GIF
And I have tried play gif from FATFS, but always crash. This is my code:
image
I already enable LV_USE_FS_FATFS flag in config file
image
how to play gif from fatfs. i flashed a .gif file to fatfs

from lvgl.

hoanglam9925 avatar hoanglam9925 commented on September 23, 2024

LVGLImage.py allowed me to try converting a gif to.C, and it worked. However, when I tried to convert to a.bin file to play from a file system, it consistently returned a.c file. I verified that the function in LVGLImage.py forces a.C file when the --cf option is set to RAW or RAW_ALPHA.
I tried to convert a .png file to .bin file it worked smoothly.
How i can to convert a gif to .bin file?

from lvgl.

liamHowatt avatar liamHowatt commented on September 23, 2024

I was able to load a 480x360 gif from a C file and from the FS as a .gif. I don't know if 128kb is enough to load your gif and satisfy the other LVGL memory needs. The memory requirements of the GIF decoder are in the docs: https://docs.lvgl.io/master/libs/gif.html#memory-requirements so if you're using 16 bit depth mode, the decoder will use 90 kB, which is almost all of the 128 kB.

Yes I see what you mean. cc @XuNeo. I think it's because there's no use case for bin files in raw format. The GIF decoder operates on C arrays or unmodified .gif files, not .bin files.

from lvgl.

XuNeo avatar XuNeo commented on September 23, 2024

The GIF decoder operates on C arrays or unmodified .gif files, not .bin files.

Yes. There's no need to (and cannot ) change the suffix from .gif to .bin

from lvgl.

hoanglam9925 avatar hoanglam9925 commented on September 23, 2024

I retested, and this time it worked when I loaded a.gif file from fatfs using the cloned library on May 27. The library I cloned on May 11th still throws errors.
image
Between two versions, is there a new version?

from lvgl.

liamHowatt avatar liamHowatt commented on September 23, 2024

I tested just now, I got the same behavior on both. But there could be something that changed which affects your platform πŸ™‚

I think you're almost out of memory and you do run out of memory in the May 11th version due to some subtle change in allocation patterns between versions. Recall this from my comment:

I don't know if 128kb is enough to load your gif and satisfy the other LVGL memory needs. The memory requirements of the GIF decoder are in the docs: https://docs.lvgl.io/master/libs/gif.html#memory-requirements so if you're using 16 bit depth mode, the decoder will use 90 kB, which is almost all of the 128 kB.

With that being said, here are the changed files since May 11th. That view is not very useful but I went through the list and the most relevant thing that changed related to GIF+FATFS was the lv_fs caching system was refactored and write caching was added. You're not writing though, so I'm not sure.

To clarify, it works with the latest version but not the May 11th version? The one thing I can think of is to try setting LV_FS_FATFS_CACHE_SIZE to 0 if it isn't already, and see if that makes the May 11th version work for you.

from lvgl.

hoanglam9925 avatar hoanglam9925 commented on September 23, 2024

LV_FS_FATFS_CACHE_SIZE is always 0. Even after increasing LV_MEM_SIZE to 256*1024, the error message still shows. I believe that something related to memory was improved in the most recent version, and it works.Β 

from lvgl.

liamHowatt avatar liamHowatt commented on September 23, 2024

256 kB sounds like enough! Since it's fixed, it's a less critical issue. If you're using Arduino IDE 2, I believe there's interactive debugging. You're welcome to try to pinpoint the cause of the failure and we can improve the related code if there's a risk of it still happening in the new versions.

from lvgl.

kisvegabor avatar kisvegabor commented on September 23, 2024

I close this issue because there was no activity here for a while.

If you have remarks about this topic feel free to comment here and reopen the issue.

from lvgl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.