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

Passed in Animation Data Object Gets Mutated #84

Open
naaish-adam opened this issue Aug 30, 2024 · 0 comments
Open

Passed in Animation Data Object Gets Mutated #84

naaish-adam opened this issue Aug 30, 2024 · 0 comments

Comments

@naaish-adam
Copy link

naaish-adam commented Aug 30, 2024

I passed in a Lottie JSON with encoded images but it was mutated and the data URI for the images in the assets array was replaced with relative URLs.

const dotLottie = new DotLottie();
  dotLottie.addAnimation({
    id: "default",
    data: animationData // This gets mutated
});

Before:

"assets": [{
    "id": "2dd5bfdae9efbf11e27d9d5046c3c14629b81d94",
    "e": 1,
    "w": 300,
    "h": 406,
    "p": "data:image/png;base64,iVBORw0KGgoAAAA...",
    "u": ""
}]

After:

"assets": [{
    "id": "gbpoBJVn-f",
    "e": 0,
    "w": 300,
    "h": 406,
    "p": "gbpoBJVn-f.png",
    "u": "/images/"
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant