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

IndexError: list index out of range #74

Closed
Mygod opened this issue Mar 25, 2017 · 12 comments
Closed

IndexError: list index out of range #74

Mygod opened this issue Mar 25, 2017 · 12 comments

Comments

@Mygod
Copy link

Mygod commented Mar 25, 2017

  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 1029, in svg2rlg
    drawing = svgRenderer.render(svg)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 362, in render
    main_group = self.renderNode(svg_node)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 383, in renderNode
    item = self.renderSvg(n)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 473, in renderSvg
    self.renderNode(child, group)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 386, in renderNode
    item = self.renderG(n)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 483, in renderG
    item = self.renderNode(child, parent=gr)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 392, in renderNode
    item = self.renderG(n, clipping=clipping)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 483, in renderG
    item = self.renderNode(child, parent=gr)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 396, in renderNode
    item = self.renderSymbol(n)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 493, in renderSymbol
    return self.renderG(node, display=0)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 483, in renderG
    item = self.renderNode(child, parent=gr)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 405, in renderNode
    item = self.shape_converter.convertShape(name, n, clipping)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 560, in convertShape
    shape = getattr(self, method_name)(node)
  File "/home/mygod/Programs/anaconda3/lib/python3.5/site-packages/svglib/svglib.py", line 870, in convertPath
    if path.operators[-1] != _CLOSEPATH:
IndexError: list index out of range
@Mygod
Copy link
Author

Mygod commented Mar 25, 2017

P.S. This error is pretty self explanatory.

@claudep
Copy link
Collaborator

claudep commented Mar 25, 2017

Do you have a svg file producing this error at hand?

@Mygod
Copy link
Author

Mygod commented Mar 25, 2017

Yes but unfortunately it's licensed (it's a sheet music). Also lots of noteheads are missing in the output. (I patched this library myself)

@claudep
Copy link
Collaborator

claudep commented Mar 25, 2017

You might send me the file privately. Of course, if you already have the patch/test, just send a pull request.

@Mygod
Copy link
Author

Mygod commented Mar 25, 2017

Actually I think I can share its first page. None of the text is displayed in PDF output even after the patch for this issue and #75. 😢

0.svgz.tar.gz

@Mygod
Copy link
Author

Mygod commented Mar 25, 2017

So far I can only see basic lines in the final output. I think I'll have to give up and use Apache's library instead to get my job done...

@claudep
Copy link
Collaborator

claudep commented Mar 25, 2017

Unfortunately, that first page does not trigger the error.

@Mygod
Copy link
Author

Mygod commented Mar 25, 2017

Hmmmm how about this...

0.svgz.tar.gz

@claudep
Copy link
Collaborator

claudep commented Mar 25, 2017

In fact, I suspect this being a duplicate of #71. Could you try that change in your code?

@Mygod
Copy link
Author

Mygod commented Mar 25, 2017

Yes. But besides this, these svgs all render poorly. 😞

@Mygod Mygod closed this as completed Mar 25, 2017
@claudep
Copy link
Collaborator

claudep commented Mar 25, 2017

I will still investigate about the rendering issues of your files, thanks for the report.

@claudep
Copy link
Collaborator

claudep commented Mar 25, 2017

The rendering issues will be tracked in #76.

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