laggykiller / rlottie-python

A ctypes API for rlottie, with additional functions for getting Pillow Image.
https://rlottie-python.readthedocs.io/en/latest/
GNU Lesser General Public License v2.1
15 stars 1 forks source link

Is the code support to parse assets in json file? #2

Closed yugaocheng closed 1 year ago

yugaocheng commented 1 year ago

i can get empty png files from my owner data when run rlottie-python/example/example.py

but i got right result in sample.json. The different between them is that i use raster image in assets.

laggykiller commented 1 year ago

Let me clarify: If you replace sample.json with your own lottie file, you get an empty png as result? Your lottie file somehow contains raster assets?

I have never heard of lottie files that contain raster assets. Can you send me the file you were using?

Edit: Are you referring to this? https://lottiefiles.github.io/lottie-docs/assets/

yugaocheng commented 1 year ago

yeah, Maybe my expression is not particularly accurate,but the raster image can be inserted as reference image as the fields ‘u‘ and ’p‘ described. well, how can i send u my own sample file?

laggykiller commented 1 year ago

I think you can upload it here by drag and drop. If that does not work, try to change the extension to txt, or upload to cloud drive and share

yugaocheng commented 1 year ago

data.txt

laggykiller commented 1 year ago

I see no problem

from rlottie_python import LottieAnimation

json_file = 'data.json'

with LottieAnimation.from_file(path=json_file) as anim:
    anim.save_animation('test1.apng')
    anim.save_animation('test2.gif')
    anim.save_animation('test3.webp')

Maybe it's because the circles are white, and the transparent background is displayed as white on your side, or you accidentally cause the transparent background to become white background (e.g. Are you using 'RGBA' mode for pillow)? Or perhaps you have selected an empty frame to convert to png?

btw You may take a look at the lottie file here: http://rlottie.com/

Show me your code? What OS? Are you running the latest version of rlottie-python?

laggykiller commented 1 year ago

Likely not a problem with this repo. I am closing this for now. If you still encounter difficulties, please re-open issue with more information.