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

Error when parsing some SVGs #62

Open
alexanderadam opened this issue Apr 11, 2020 · 0 comments
Open

Error when parsing some SVGs #62

alexanderadam opened this issue Apr 11, 2020 · 0 comments

Comments

@alexanderadam
Copy link

alexanderadam commented Apr 11, 2020

This is the backtrace:

example 1:

Traceback (most recent call last):
  File "/app/mDraw.py", line 530, in loadPic
    self.pic = SvgParser.SvgParser(filename,self.scene)
  File "/app/SvgParser.py", line 144, in __init__
    self.parse(filename)
  File "/app/SvgParser.py", line 724, in parse
    self.parseChildNodes(root)
  File "/app/SvgParser.py", line 717, in parseChildNodes
    tf = self.parseNode(n,deep)
  File "/app/SvgParser.py", line 690, in parseNode
    self.parsePath(node)
  File "/app/SvgParser.py", line 417, in parsePath
    bzseg = buildQuadraticBezierSegment(pbuff[0],pbuff[1],pbuff[2])
  File "/app/SvgParser.py", line 54, in buildQuadraticBezierSegment
    segList.append(p2[0], p2[1])
TypeError: append() takes exactly one argument (2 given)

example 2:

Traceback (most recent call last):
  File "/app/mDraw.py", line 530, in loadPic
    self.pic = SvgParser.SvgParser(filename,self.scene)
  File "/app/SvgParser.py", line 145, in __init__
    self.parse(filename)
  File "/app/SvgParser.py", line 725, in parse
    self.parseChildNodes(root)
  File "/app/SvgParser.py", line 718, in parseChildNodes
    tf = self.parseNode(n,deep)
  File "/app/SvgParser.py", line 691, in parseNode
    self.parsePath(node)
  File "/app/SvgParser.py", line 422, in parsePath
    self.lineTo(s[0],s[1])
TypeError: 'float' object is not subscriptable

example 3:

-2 M10 EGG 3200.00 0.00 60.00 A0 B0 S0 U0 D0

0 /app/test.svg
  parse-> svg
  >> path 1
  >> g 1
  unknow g
   parse-> g
   >> path 1
Traceback (most recent call last):
  File "/app/mDraw.py", line 530, in loadPic
    self.pic = SvgParser.SvgParser(filename,self.scene)
  File "/app/SvgParser.py", line 144, in __init__
    self.parse(filename)
  File "/app/SvgParser.py", line 724, in parse
    self.parseChildNodes(root)
  File "/app/SvgParser.py", line 713, in parseChildNodes
    self.parseChildNodes(n,deep+1)
  File "/app/SvgParser.py", line 717, in parseChildNodes
    tf = self.parseNode(n,deep)
  File "/app/SvgParser.py", line 690, in parseNode
    self.parsePath(node)
  File "/app/SvgParser.py", line 495, in parsePath
    dx=float(ss[ptr])
ValueError: could not convert string to float: '2.621.537'

PS: Maybe they are related to #46 and/or #45?

@alexanderadam alexanderadam changed the title Error when parsing some SVG Error when parsing some SVGs Apr 11, 2020
alexanderadam added a commit to alexanderadam/mDrawBot that referenced this issue Apr 12, 2020
alexanderadam added a commit to alexanderadam/mDrawBot that referenced this issue Apr 12, 2020
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