+
Skip to content

lottie: fix & enhance parsing #3194

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

lottie: fix & enhance parsing #3194

wants to merge 1 commit into from

Conversation

mgrudzinska
Copy link
Collaborator

@mgrudzinska mgrudzinska commented Feb 7, 2025

The object type key does not need to be provided
first. Previously, content was skipped until the
"ty" type key was found. If the key was placed at
the end, the entire object was ignored.
Now, before parsing subsequent elements, finding
the "ty" key is enforced. Since in-situ parsing
does not support backtracking, the key is searched with an internal function.

Introducing support for the "ty" key placed anywhere highlighted the use of redundant logic for parsing the list of shapes — this duplicate logic has been removed.

before:
Zrzut ekranu 2024-05-30 o 01 42 45

after:
Zrzut ekranu 2024-05-30 o 01 27 31

previous version with discussion:
#2330

@mgrudzinska mgrudzinska added enhancement Improve features lottie Lottie animation labels Feb 7, 2025
@mgrudzinska mgrudzinska self-assigned this Feb 7, 2025
@mgrudzinska mgrudzinska requested a review from hermet as a code owner February 7, 2025 13:22
@hermet hermet marked this pull request as draft February 7, 2025 14:48
@hermet hermet force-pushed the main branch 2 times, most recently from b234c07 to f1e9ce0 Compare March 17, 2025 06:28
@hermet hermet force-pushed the main branch 2 times, most recently from 964770d to dadd7a9 Compare March 31, 2025 14:34
@hermet hermet force-pushed the main branch 2 times, most recently from fcbdcc9 to e20562c Compare June 19, 2025 07:11
@mgrudzinska mgrudzinska force-pushed the mira/format branch 2 times, most recently from 52bfa08 to 72cc9d2 Compare June 20, 2025 22:24
@hermet
Copy link
Member

hermet commented Jun 21, 2025

Parsing back and forth in a haphazard way is highly inefficient, and it's not just an issue of covering 'ty' - it needs a general method.

@hermet hermet force-pushed the main branch 8 times, most recently from 7ceb794 to 43923a5 Compare June 25, 2025 15:59
The object type key does not need to be provided
first. Previously, content was skipped until the
"ty" type key was found. If the key was placed at
the end, the entire object was ignored.
Now, before parsing subsequent elements, finding
the "ty" key is enforced. Since in-situ parsing
does not support backtracking, the key is searched
with an internal function.

Introducing support for the "ty" key placed anywhere
highlighted the use of redundant logic for parsing
the list of shapes — this duplicate logic has been
removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve features lottie Lottie animation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载