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

[BUG]: Can't parse SVG that was working with 5.3 but fails with 6.0 #8852

Closed
asturur opened this issue Apr 21, 2023 · 5 comments
Closed

[BUG]: Can't parse SVG that was working with 5.3 but fails with 6.0 #8852

asturur opened this issue Apr 21, 2023 · 5 comments
Assignees
Labels

Comments

@asturur
Copy link
Member

asturur commented Apr 21, 2023

Svg string:

<svg xmlns="http://www.w3.org/2000/svg" width="141.62709" height="177.32715" viewBox="0 0 141.62709 177.32715"><defs><style>.a {fill: rgba(255,245,158,1);}.b {fill: rgba(231,233,238,1);}.c {fill: rgba(26,26,26,1);}</style></defs><title>Asset 274</title><g><g><path class="a" d="M119.00235,76.03634a48.18923,48.18923,0,1,0-83.14617,33.16314c7.68635,8.09729,16.53091,26.414,16.53091,37.57854v.19941H89.24v-.20186c0-10.99156,8.53738-29.32289,16.18614-37.21661A48.01756,48.01756,0,0,0,119.00235,76.03634Z"/><path class="b" d="M91.63239,150.8877v-.74805a3.16217,3.16217,0,0,0-3.16211-3.16211H53.15681a3.16217,3.16217,0,0,0-3.16211,3.16211v.74805a3.16216,3.16216,0,0,0,3.16211,3.1621,3.16217,3.16217,0,0,0-3.16211,3.16211V157.96a3.16217,3.16217,0,0,0,3.16211,3.16211,3.16248,3.16248,0,0,0-3.16211,3.16211v.74805a3.16217,3.16217,0,0,0,3.16211,3.16211H88.47028a3.16217,3.16217,0,0,0,3.16211-3.16211v-.74805a3.16248,3.16248,0,0,0-3.16211-3.16211A3.16217,3.16217,0,0,0,91.63239,157.96v-.74805a3.16217,3.16217,0,0,0-3.16211-3.16211A3.16216,3.16216,0,0,0,91.63239,150.8877Z"/><path class="b" d="M62.87543,168.19448H78.75166a0,0,0,0,1,0,0v1.9884a6.394,6.394,0,0,1-6.394,6.394H69.26939a6.394,6.394,0,0,1-6.394-6.394v-1.9884A0,0,0,0,1,62.87543,168.19448Z"/><path class="c" d="M119.75251,76.03613a48.94079,48.94079,0,0,0-51.251-48.88525,49.21275,49.21275,0,0,0-46.582,46.77148,48.58615,48.58615,0,0,0,13.39258,35.79346c7.3418,7.73389,16.19336,25.79443,16.31934,36.82178a3.91783,3.91783,0,0,0-2.38672,3.602v.74805a3.90063,3.90063,0,0,0,1.62842,3.1621,3.90067,3.90067,0,0,0-1.62842,3.16211V157.96a3.90065,3.90065,0,0,0,1.62842,3.16211,3.90067,3.90067,0,0,0-1.62842,3.16211v.74805a3.91644,3.91644,0,0,0,3.91211,3.91211h8.96875v1.23828a7.15217,7.15217,0,0,0,7.14355,7.14453H72.358a7.15217,7.15217,0,0,0,7.14355-7.14453v-1.23828h8.96875a3.91644,3.91644,0,0,0,3.91211-3.91211v-.74805a3.90068,3.90068,0,0,0-1.62841-3.16211A3.90067,3.90067,0,0,0,92.38239,157.96v-.74805A3.90068,3.90068,0,0,0,90.754,154.0498a3.90065,3.90065,0,0,0,1.62841-3.1621v-.74805a3.9186,3.9186,0,0,0-2.38672-3.602c.12012-11.21,8.7837-29.04151,15.96875-36.45655A48.67571,48.67571,0,0,0,119.75251,76.03613Zm-41.751,94.14649a5.65053,5.65053,0,0,1-5.64355,5.64453H69.26911a5.65053,5.65053,0,0,1-5.64355-5.64453v-1.23828h14.376Zm12.88086-5.89844v.74805a2.4148,2.4148,0,0,1-2.41211,2.41211H53.15681a2.4148,2.4148,0,0,1-2.41211-2.41211v-.74805a2.41479,2.41479,0,0,1,2.41211-2.41211H88.47028A2.41479,2.41479,0,0,1,90.88239,164.28418Zm0-7.07227V157.96a2.41479,2.41479,0,0,1-2.41211,2.41211H53.15681A2.41479,2.41479,0,0,1,50.7447,157.96v-.74805a2.4148,2.4148,0,0,1,2.41211-2.41211H88.47028A2.4148,2.4148,0,0,1,90.88239,157.21191Zm0-7.07226v.74805a2.41479,2.41479,0,0,1-2.41211,2.4121H53.15681a2.41479,2.41479,0,0,1-2.41211-2.4121v-.74805a2.41479,2.41479,0,0,1,2.41211-2.41211H88.47028A2.41479,2.41479,0,0,1,90.88239,150.13965ZM66.70417,108.6582H58.022a8.69142,8.69142,0,0,1-8.68164-8.68164v-.001a8.68189,8.68189,0,0,1,17.36377.001Zm1.5,37.56934V110.1582h5.21875v36.06934Zm20.29248,0H74.92292V110.1582h8.68213A10.18164,10.18164,0,1,0,73.42292,99.97656v8.68164H68.20417V99.97656A10.18189,10.18189,0,1,0,58.022,110.1582h8.68213v36.06934H53.13044c-.27637-11.55225-9.1123-29.519-16.73047-37.54443A47.099,47.099,0,0,1,23.418,73.98535,47.70242,47.70242,0,0,1,68.57038,28.64941a47.43566,47.43566,0,0,1,36.3169,80.3877C97.57673,116.582,88.77107,134.66553,88.49665,146.22754ZM74.92292,108.6582V99.97656a8.68189,8.68189,0,1,1,8.68213,8.68164Z"/><path class="c" d="M36.79475,70.07764l-.032-.00074a.74975.74975,0,0,1-.71777-.78076A32.2779,32.2779,0,0,1,66.597,38.61987a.75006.75006,0,0,1,.06885,1.49854A30.76737,30.76737,0,0,0,37.54353,69.35913.75.75,0,0,1,36.79475,70.07764Z"/></g><g><path class="c" d="M70.81355,21.07861a.74988.74988,0,0,1-.75-.75V.75a.75.75,0,0,1,1.5,0V20.32861A.74988.74988,0,0,1,70.81355,21.07861Z"/><path class="c" d="M37.66828,33.14258a.74814.74814,0,0,1-.575-.26782l-12.585-14.99805a.75.75,0,0,1,1.14893-.96436l12.585,14.99805a.75.75,0,0,1-.574,1.23218Z"/><path class="c" d="M20.0323,63.69019a.74808.74808,0,0,1-.13111-.01172L.61994,60.27856a.7499.7499,0,1,1,.26026-1.477l19.28125,3.39991a.75009.75009,0,0,1-.12915,1.48877Z"/><path class="c" d="M121.5948,63.69019a.75009.75009,0,0,1-.12915-1.48877l19.28125-3.39991a.7499.7499,0,0,1,.26025,1.477L121.7259,63.67847A.75011.75011,0,0,1,121.5948,63.69019Z"/><path class="c" d="M103.95881,33.14258a.75.75,0,0,1-.574-1.23218l12.585-14.998a.75.75,0,1,1,1.14892.96436l-12.585,14.99805A.74814.74814,0,0,1,103.95881,33.14258Z"/></g></g></svg>
@asturur asturur self-assigned this Apr 21, 2023
@asturur asturur added the bug label Apr 21, 2023
@pixobe
Copy link

pixobe commented Apr 22, 2023

Adding on top of it, when using loadSVGFromUrl method, getting error for this svg https://github.com/microsoft/fluentui-emoji/blob/main/assets/Accordion/Color/accordion_color.svg , while this one works fine https://github.com/microsoft/fluentui-emoji/blob/main/assets/Abacus/Color/abacus_color.svg

Error Log,

caught DOMException: Failed to execute 'createPattern' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.
    at Path._applyPatternForTransformedGradient (http://localhost:3333/build/index-446da9ae.js:7957:51)
    at Path._setStrokeStyles (http://localhost:3333/build/index-446da9ae.js:7745:16)
    at Path._renderStroke (http://localhost:3333/build/index-446da9ae.js:7915:10)
    at Path._renderPaintInOrder (http://localhost:3333/build/index-446da9ae.js:7865:12)
    at Path._render (http://localhost:3333/build/index-446da9ae.js:15736:10)
    at Path.drawObject (http://localhost:3333/build/index-446da9ae.js:7641:10)
    at Path.render (http://localhost:3333/build/index-446da9ae.js:7503:12)
    at Group.drawObject (http://localhost:3333/build/index-446da9ae.js:10877:26)
    at Group.renderCache (http://localhost:3333/build/index-446da9ae.js:7516:12)
    at Group.render (http://localhost:3333/build/index-446da9ae.js:7498:12)

Version 6-beta3

Code ,

 loadSVGFromURL(url, () => {
          // const options = Object.assign(defaultImageConfig, config);
          var loadedObjects = new Group(group);
          loadedObjects.set(config);
          return res(loadedObjects);
      }, (item, object) => {
          object.set('id', item.getAttribute('id'));
          group.push(object);
      }, {});
      

@asturur
Copy link
Member Author

asturur commented Apr 22, 2023

thank you.
I m looking at the first one now and moving to the second.

@asturur
Copy link
Member Author

asturur commented Apr 22, 2023

Both are fixe now, require a mini review and i can merge

@pixobe
Copy link

pixobe commented Apr 27, 2023

@asturur you are doing amazing job

@asturur
Copy link
Member Author

asturur commented Apr 28, 2023

Thank you i m not doing much last period, but thanks for cheering up.

@asturur asturur closed this as completed Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants