Coder Social home page Coder Social logo

Comments (11)

hermet avatar hermet commented on July 28, 2024 1

@theashraf It looks like invalid JSON data (the whole text shouldn't be quoted). Could you please use this?

{"v":"5.5.1","ip":0,"op":60.0,"fr":30.0,"w":300.0,"h":300.0,"nm":"C","assets":[],"layers":[{"ind":1,"ty":4,"nm":"S","sr":1.0,"ks":{"o":{"a":0,"k":100.0},"r":{"a":0,"k":0},"p":{"a":0,"k":[159.5,252.0,0]},"a":{"a":0,"k":[0.5,104.0,0]},"s":{"a":0,"k":[100.0,100.0,100.0]}},"shapes":[{"ty":"gr","nm":"E","bm":0,"it":[{"ty":"el","nm":"E","d":1,"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[45.0,45.0]}},{"ty":"fl","nm":"F","bm":0,"c":{"a":0,"k":[1.0,0,0,1.0]},"o":{"a":0,"k":100.0},"r":1},{"ty":"tr","o":{"a":0,"k":100.0},"r":{"a":0,"k":0},"p":{"a":0,"k":[0.5,104.0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100.0,100.0]},"nm":"T","sk":{"a":0,"k":0},"sa":{"a":0,"k":0}}]},{"ty":"rp","nm":"R","c":{"a":0,"k":8.0},"o":{"a":0,"k":-17.0},"m":1.0,"tr":{"ty":"tr","nm":"T","p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[-5.0,5.0]},"s":{"a":0,"k":[100.0,100.0]},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[45.0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":30.0,"s":[0]},{"t":60.0,"s":[-45.0]}]},"so":{"a":0,"k":25.0},"eo":{"a":0,"k":100.0}}}],"ip":0,"op":60.0,"st":0}],"markers":[]}

from thorvg.

mgrudzinska avatar mgrudzinska commented on July 28, 2024 1

when I tried to load the data one problem was a crash - solved here

the other problem is that in this data in the repeater section, the Composite is float and I think it should be integer. right?
Zrzut ekranu 2024-06-11 o 15 02 14

afterr applying 2392 and changing "m" = 1, it worked

from thorvg.

theashraf avatar theashraf commented on July 28, 2024 1

I wonder if ThorVG can cast that specific property to an integer. Would that be okay ?

@theashraf If the Lottie data (JSON) violates the spec, it must be fixed there because we can't guarantee the resource compatibility with other situations(i.e other players).

Thanks @hermet, makes sense. i'll report to the user

from thorvg.

hermet avatar hermet commented on July 28, 2024 1

@

I wonder if ThorVG can cast that specific property to an integer. Would that be okay ?

@theashraf If the Lottie data (JSON) violates the spec, it must be fixed there because we can't guarantee the resource compatibility with other situations(i.e other players).

Thanks @hermet, makes sense. i'll report to the user

@theashraf It will be nice if we know which design tools or toolkits/libraries, the user used for exporting the resource. If it's related to our service, then we can correct the root-cause there.

from thorvg.

hermet avatar hermet commented on July 28, 2024 1

@theashraf The fix will be applied in version 0.14.1. Please note that incompatible type values could be ignored (set to 0).

from thorvg.

theashraf avatar theashraf commented on July 28, 2024

@hermet my bad, the extra double quote is from my debugging message, but it's passed to thorvg without the wrapping double quotes as you mentioned

from thorvg.

hermet avatar hermet commented on July 28, 2024

@theashraf then it should work. I confirmed it works on thorvg-viewer.

from thorvg.

theashraf avatar theashraf commented on July 28, 2024

@hermet, I've tested it on the ThorVG viewer as well, and it works fine. but, I'm not sure why I'm unable to load it using the tvg_picture_load_data C API.

Here is the exact valid JSON string passed to tvg_picture_load_data 😕

{\"v\": \"5.5.1\", \"ip\": 0.0, \"op\": 60.0, \"fr\": 30.0, \"w\": 300.0, \"h\": 300.0, \"nm\": \"C\", \"assets\": [], \"layers\": [{\"ind\": 1, \"ty\": 4, \"nm\": \"S\", \"sr\": 1.0, \"ks\": {\"o\": {\"a\": 0, \"k\": 100.0}, \"r\": {\"a\": 0, \"k\": 0.0}, \"p\": {\"a\": 0, \"k\": [159.5, 252.0, 0.0]}, \"a\": {\"a\": 0, \"k\": [0.5, 104.0, 0.0]}, \"s\": {\"a\": 0, \"k\": [100.0, 100.0, 100.0]}}, \"shapes\": [{\"ty\": \"gr\", \"nm\": \"E\", \"bm\": 0, \"it\": [{\"ty\": \"el\", \"nm\": \"E\", \"d\": 1, \"p\": {\"a\": 0, \"k\": [0.0, 0.0]}, \"s\": {\"a\": 0, \"k\": [45.0, 45.0]}}, {\"ty\": \"fl\", \"nm\": \"F\", \"bm\": 0, \"c\": {\"a\": 0, \"k\": [1.0, 0.0, 0.0, 1.0]}, \"o\": {\"a\": 0, \"k\": 100.0}, \"r\": 1}, {\"ty\": \"tr\", \"o\": {\"a\": 0, \"k\": 100.0}, \"r\": {\"a\": 0, \"k\": 0.0}, \"p\": {\"a\": 0, \"k\": [0.5, 104.0]}, \"a\": {\"a\": 0, \"k\": [0.0, 0.0]}, \"s\": {\"a\": 0, \"k\": [100.0, 100.0]}, \"nm\": \"T\", \"sk\": {\"a\": 0, \"k\": 0.0}, \"sa\": {\"a\": 0, \"k\": 0.0}}]}, {\"ty\": \"rp\", \"nm\": \"R\", \"c\": {\"a\": 0, \"k\": 8.0}, \"o\": {\"a\": 0, \"k\": -17.0}, \"m\": 1.0, \"tr\": {\"ty\": \"tr\", \"nm\": \"T\", \"p\": {\"a\": 0, \"k\": [0.0, 0.0]}, \"a\": {\"a\": 0, \"k\": [-5.0, 5.0]}, \"s\": {\"a\": 0, \"k\": [100.0, 100.0]}, \"r\": {\"a\": 1, \"k\": [{\"i\": {\"x\": [0.833], \"y\": [0.833]}, \"o\": {\"x\": [0.167], \"y\": [0.167]}, \"t\": 0.0, \"s\": [45.0]}, {\"i\": {\"x\": [0.833], \"y\": [0.833]}, \"o\": {\"x\": [0.167], \"y\": [0.167]}, \"t\": 30.0, \"s\": [0.0]}, {\"t\": 60.0, \"s\": [-45.0]}]}, \"so\": {\"a\": 0, \"k\": 25.0}, \"eo\": {\"a\": 0, \"k\": 100.0}}}], \"ip\": 0.0, \"op\": 60.0, \"st\": 0.0}], \"markers\": []}

from thorvg.

theashraf avatar theashraf commented on July 28, 2024

the other problem is that in this data in the repeater section, the Composite is float and I think it should be integer. right?
Zrzut ekranu 2024-06-11 o 15 02 14

Thanks @mgrudzinska !!

You're right, but this asset is from Iconscout, and I'm not sure which Lottie plugin was used to export that specific animation. I wonder if ThorVG can cast that specific property to an integer. Would that be okay ?

from thorvg.

hermet avatar hermet commented on July 28, 2024

I wonder if ThorVG can cast that specific property to an integer. Would that be okay ?

@theashraf If the Lottie data (JSON) violates the spec, it must be fixed there because we can't guarantee the resource compatibility with other situations(i.e other players).

from thorvg.

hermet avatar hermet commented on July 28, 2024

when I tried to load the data one problem was a crash - solved here

@mgrudzinska This is not the issue point. Strings are expected to end with \0. Otherwise, it is an invalid parameter due to user error. We can deal it just as for the exceptional handling just in case user mistake(your sample might have also this), but please note that it's not the thorvg responsibility.

from thorvg.

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.