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

get NaN in the path. #1185

Closed
lihanqi opened this issue Nov 1, 2019 · 1 comment
Closed

get NaN in the path. #1185

lihanqi opened this issue Nov 1, 2019 · 1 comment

Comments

@lihanqi
Copy link

lihanqi commented Nov 1, 2019

Version 0.7.2

The original svg file:

<?xml version="1.0" encoding="UTF-8"?>
<svg width="70px" height="82px" viewBox="0 0 70 82" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 59.1 (86144) - https://sketch.com -->
    <title>Group</title>
    <desc>Created with Sketch.</desc>
    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group" transform="translate(0.080114, 0.000044)" fill-rule="nonzero">
            <path d="M66.1518293,54.7681734 C63.9474351,60.7425012 60.6136251,65.9371881 56.2417536,70.2064421 C51.2654414,75.0657457 44.7492443,78.9270336 36.8739941,81.6814314 C36.6155738,81.7715344 36.3458905,81.8453689 36.0749559,81.899806 C35.7170467,81.9705119 35.3528806,82.0086805 34.991843,82.0136862 L34.9211371,82.0136862 C34.5363224,82.0136862 34.1496304,81.9748918 33.7660671,81.899806 C33.4951325,81.8453689 33.2292035,81.7715344 32.9720347,81.6833086 C25.0873987,78.9332907 18.5630673,75.0738799 13.5817492,70.2145765 C9.20800075,65.9453223 5.87481636,60.7537642 3.67355071,54.7794364 C-0.329148926,43.9170222 -0.101388468,31.9508466 0.081946017,22.3348569 L0.0850745525,22.1871881 C0.121991784,21.3931557 0.145768877,20.5590773 0.158909015,19.6380247 C0.225860411,15.1159818 3.82121947,11.3748311 8.34388824,11.1226679 C17.7734148,10.5964415 25.0680015,7.52105175 31.3007496,1.44598386 L31.3551869,1.39592665 C32.3901196,0.446716718 33.6941098,-0.0188153185 34.991843,-1.42108547e-14 C36.2432732,0.0168505625 37.4896977,0.481756764 38.4877134,1.39592665 L38.5408991,1.44598386 C44.7748987,7.52105175 52.0694853,10.5964415 61.499012,11.1226679 C66.0216806,11.3748311 69.6170397,15.1159818 69.6839912,19.6380247 C69.6971312,20.5653345 69.7209083,21.3981614 69.7578255,22.1871881 L69.7597027,22.2497596 C69.9424115,31.883895 70.1689205,43.8738479 66.1518293,54.7681734 Z" id="Path" fill="#2557B0"></path>
            <path d="M66.1518293,54.7681734 C63.9474351,60.7425012 60.6136251,65.9371881 56.2417536,70.2064421 C51.2654414,75.0657457 44.7492443,78.9270336 36.8739941,81.6814314 C36.6155738,81.7715344 36.3458905,81.8453689 36.0749559,81.899806 C35.7170467,81.9705119 35.3528806,82.0086805 34.991843,82.0136862 L34.991843,0.000581929767 C36.2432732,0.0168505625 37.4896977,0.481756764 38.4877134,1.39592665 L38.5408991,1.44598386 C44.7748987,7.52105175 52.0694853,10.5964415 61.499012,11.1226679 C66.0216806,11.3748311 69.6170397,15.1159818 69.6839912,19.6380247 C69.6971312,20.5653345 69.7209083,21.3981614 69.7578255,22.1871881 L69.7597027,22.2497596 C69.9424115,31.883895 70.1689205,43.8738479 66.1518293,54.7681734 Z" id="Path" fill="#0F2346"></path>
            <path d="M55.3594952,41.0068212 C55.3594952,52.2527987 46.2284348,61.4070107 34.991843,61.4470565 L34.9198858,61.4470565 C23.650131,61.4470565 14.4796505,52.2772016 14.4796505,41.0068212 C14.4796505,29.7370664 23.650131,20.5672117 34.9198858,20.5672117 L34.991843,20.5672117 C46.2284348,20.6072575 55.3594952,29.7614694 55.3594952,41.0068212 Z" id="Path" fill="#FFFFFF"></path>
            <path d="M55.3594952,41.0068212 C55.3594952,52.2527987 46.2284348,61.4070107 34.991843,61.4470565 L34.991843,20.5672117 C46.2284348,20.6072575 55.3594952,29.7614694 55.3594952,41.0068212 Z" id="Path" fill="#E1EBF0"></path>
            <path d="M44.1973636,38.0634574 L34.991843,47.2702293 L33.0026947,49.2593777 C32.5327826,49.7292897 31.9164533,49.9639329 31.3007496,49.9639329 C30.6844203,49.9639329 30.0687166,49.7292897 29.5981789,49.2593777 L25.3214161,44.9807379 C24.3815921,44.0409137 24.3815921,42.5185489 25.3214161,41.5780991 C26.2599887,40.638275 27.7842307,40.638275 28.7240547,41.5780991 L31.3007496,44.1547939 L40.7947248,34.6608185 C41.734549,33.7203689 43.258791,33.7203689 44.1973636,34.6608185 C45.1371876,35.6006427 45.1371876,37.1248847 44.1973636,38.0634574 Z" id="Path" fill="#2557B0"></path>
        </g>
    </g>
</svg>

after svgo minify, the result svg:

<svg width="70" height="82" xmlns="http://www.w3.org/2000/svg"><g fill="none"><path d="M66.232 54.768c-2.204 5.975-5.538 11.17-9.91 15.438-4.976 4.86-11.493 8.721-19.368 11.475-.258.09-.528.164-.799.219-.358.07-.722.109-1.083.114h-.07a6.014 6.014 0 1-1.95-.33 NaNc-9.504 NaN-16.029 NaN-21.01 NaN-4.374 NaN-7.707 NaN-9.908 NaNC-.25 NaN-.021 NaN.162 NaNl.003 NaNc.037 NaN.06 NaN.074 NaN.067 NaN 3.662 NaN 8.185 NaN 9.43 NaN 16.724 NaN 22.957 NaNl.054 NaNa5.254 5.254 0 17.133 0 NaN NaNlNaN NaNcNaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaNlNaN NaNcNaN NaN NaN NaN NaN NaNz" fill="#2557B0"/>
    <path d="M66.232 54.768c-2.204 5.975-5.538 11.17-9.91 15.438-4.976 4.86-11.493 8.721-19.368 11.475-.258.09-.528.164-.799.219-.358.07-.722.109-1.083.114V0a5.262 5.262 0 13.496 1.395 NaN NaNlNaN NaNcNaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaNlNaN NaNcNaN NaN NaN NaN NaN NaNz" fill="#0F2346"/>
    <path d="M55.44 41.007c0 11.246-9.131 20.4-20.368 20.44H35c-11.27 0-20.44-9.17-20.44-20.44 0-11.27 9.17-20.44 20.44-20.44h.072c11.237.04 20.368 9.195 20.368 20.44z" fill="#FFF"/>
    <path d="M55.44 41.007c0 11.246-9.131 20.4-20.368 20.44v-40.88c11.237.04 20.368 9.195 20.368 20.44z" fill="#E1EBF0"/>
    <path d="M44.277 38.064l-9.205 9.206-1.99 1.99a2.4 2.4 0 1-1.701.704 2.401lNaN NaN NaN NaNa2.406 2.406 0 113.402-3.403 NaN NaNlNaN NaN NaN NaNa2.406 2.406 0 113.403 3.403 NaN NaNz" fill="#2557B0"/>
</g></svg>

You can see there are NaN in the path.

@GreLI
Copy link
Member

GreLI commented Nov 2, 2019

0.7.2 is quite outdated. Update to v1.1 at least

@GreLI GreLI closed this as completed Nov 2, 2019
buck06191 added a commit to guardian/frontend that referenced this issue Apr 21, 2021
Updates SVGO version and its implementation. This is required due to an
error with some SVGs for the previous version: svg/svgo#1185
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

2 participants