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

Is this support open .lottie file? #295

Open
tbm98 opened this issue Aug 23, 2023 · 10 comments
Open

Is this support open .lottie file? #295

tbm98 opened this issue Aug 23, 2023 · 10 comments
Labels
documentation Improvements or additions to documentation

Comments

@tbm98
Copy link

tbm98 commented Aug 23, 2023

Is this support open .lottie file?

@xvrh xvrh added the documentation Improvements or additions to documentation label Aug 30, 2023
@canturkay
Copy link

I would also like to hear about this. Dot lottie files are much smaller in size, one of the reasons we're using lottie in the first place.

@xvrh
Copy link
Owner

xvrh commented Sep 4, 2023

@canturkay you can already compress a json file to a zip file and AFAIK it will have the same size saving as dotlottie.
Unless I'm misunderstanding something, his is already supported.

@abdullah-cse
Copy link

@canturkay you can already compress a json file to a zip file and AFAIK it will have the same size saving as dotlottie.
Unless I'm misunderstanding something, his is already supported.

Does support added for .lottie???

@canturkay
Copy link

@canturkay you can already compress a json file to a zip file and AFAIK it will have the same size saving as dotlottie.
Unless I'm misunderstanding something, his is already supported.

Does support added for .lottie???

As mentioned by @xvrh , you can just zip the .json file and use it as .zip. It should have the same size as .lottie.

So instead of using .lottie file, convert it to .json format, and then zip it.

@abdullah-cse
Copy link

@canturkay you can already compress a json file to a zip file and AFAIK it will have the same size saving as dotlottie.
Unless I'm misunderstanding something, his is already supported.

Does support added for .lottie???

As mentioned by @xvrh , you can just zip the .json file and use it as .zip. It should have the same size as .lottie.

So instead of using .lottie file, convert it to .json format, and then zip it.

One more question, loading from .json vs .zip, What about performance perspective?
Does .zip costier as it needs to Unzip, then animate?

@canturkay
Copy link

@canturkay you can already compress a json file to a zip file and AFAIK it will have the same size saving as dotlottie.
Unless I'm misunderstanding something, his is already supported.

Does support added for .lottie???

As mentioned by @xvrh , you can just zip the .json file and use it as .zip. It should have the same size as .lottie.
So instead of using .lottie file, convert it to .json format, and then zip it.

One more question, loading from .json vs .zip, What about performance perspective? Does .zip costier as it needs to Unzip, then animate?

I don't know technically how it works, but I wold assume it would be more costly. However, I see no issues on my app although I have like 10 decent animations on a single page.

@xvrh
Copy link
Owner

xvrh commented Sep 22, 2023

@canturkay What is your use case for compressing the animation in .zip?

On Android the .apk are themself compressed archive. Link
On iOS, an .ipa is a compressed archive Link
On the web, you can turn-on gzip on your server for the .json responses.

I'm trying to understand where it makes a difference to have it compressed?

@AldoMX
Copy link

AldoMX commented Sep 26, 2023

There is a document called "numbers every programmer should know", from that document you can learn that unzipping a file is cheaper than downloading the file from the internet (which is why web servers enable gzip compression by default).

In the case of having the file locally, it depends on the file system. NTFS uses 4kb clusters by default, but exFAT uses 128kb clusters, so having a 200 byte vs a 128kb file makes no difference because the operating system reads/writes the whole cluster anyway (this is the reason why copying a lot of small files is slow, but compressing the folder and copying the zip is fast).

Anyway, I'm not here to talk about "numbers that every programmer should know", but to ask whether adding support for dotLottie files is planned, because dotLottie includes features like state machines to switch between animations and its not just "a zipped json":

https://dotlottie.io/structure/

@xvrh
Copy link
Owner

xvrh commented Sep 26, 2023

@AldoMX can you list precisely the features from dotLottie that you would like?

Smaller size was listed above and I answered that this is already supported (although I don't really see the value myself).

Can you provide some representative dotLottie examples? What changes to the API would be necessary to make use of it?

@AldoMX
Copy link

AldoMX commented Sep 26, 2023

There are only 3 features for now:

https://dotlottie.io/features/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants