Background bitmap causes python extension to crash?

This is NOT a support forum. You are welcome to discuss software issues here, but all issues should be reported on Launchpad if you want them fixed.
Greengoat
Posts: 2
Joined: Fri Aug 07, 2015 6:08 am

Background bitmap causes python extension to crash?

Postby Greengoat » Fri Aug 07, 2015 6:24 am

Hey folks, I am a big fan of Inkscape and have used it for many projects along with GIMP. I am really perplexed when I came upon an issue recently.
I am doing a vector tracing of a bitmap image and I am editing a simple path "by hand" with the pencil and pen tool over a separate layer containing the bitmap. Everything went fine until I tried to run the "Modify Path > Add Nodes" extension on the simplified path. The python extension seemed to crash and gave me the following error message:

Code: Select all

Traceback (most recent call last):
  File "addnodes.py", line 113, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 211, in affect
    self.parse()
  File "/usr/share/inkscape/extensions/inkex.py", line 139, in parse
    self.document = etree.parse(stream)
  File "lxml.etree.pyx", line 3239, in lxml.etree.parse (src/lxml/lxml.etree.c:69955)
  File "parser.pxi", line 1769, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:102257)
  File "parser.pxi", line 1789, in lxml.etree._parseFilelikeDocument (src/lxml/lxml.etree.c:102516)
  File "parser.pxi", line 1684, in lxml.etree._parseDocFromFilelike (src/lxml/lxml.etree.c:101442)
  File "parser.pxi", line 1134, in lxml.etree._BaseParser._parseDocFromFilelike (src/lxml/lxml.etree.c:97069)
  File "parser.pxi", line 582, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:91275)
  File "parser.pxi", line 683, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:92461)
  File "parser.pxi", line 622, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:91757)
lxml.etree.XMLSyntaxError: AttValue length too long, line 64, column 10000014


When I pasted the path into a new file the Add Nodes worked fine.
When I remove the bitmap object from the original file the Add Nodes extension seems to run fine as well, but this workaround would be a big hassle since I still need the bitmap background to work from and re-pasting it in seems irritating.
The bitmap is about 5000px by 4000px so I don't know why it is choking.

Any suggestions would be appreciated.

Edited to add that I am using Inkscape on Linux Mint 17.1

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Background bitmap causes python extension to crash?

Postby brynn » Fri Aug 07, 2015 9:32 am

I can't speak to the technical issues, or the traceback info. But I can say that I've had multiple issues with the Add Nodes extension. It frequently not just doesn't work, but crashes Inkscape when I try to use it. I haven't ever seen a traceback for this extension. (I'm on Windows, and it's crashed Inkscape versions 0.46 through and including 0.91 in both WinXP and Win7.) (Possibly going back as far as 0.44, but I don't remember well enough, that far back, to say for sure.)

And just the same as with you, when I'm getting ready to report the problem, and I try the reproduce it in a new blank file, there's no crash. So without being able to submit a test file, I just don't report it. But it does seem to be unstable, to say the least.

Pehaps it could be reported, and perhaps your traceback info will help. But unless it's strictly file size, it seems like there may be multiple triggers to the malfunction. I can't say whether I've had imported rasters in the files where I've had crashes in the past. I'm sure that if I have, there has not been an imported raster every time it's crashed. What I do remember, is that it's almost always a large file.

By the way, when you say
The bitmap is about 5000px by 4000px so I don't know why it is choking.

you seem to think that's a small image. But it seems quite large to me! Doing some very rough calculations, that must be approx 4 feet by 3 feet

In any case, because it's easy enough to select all nodes (Ctrl + a) and click Add Nodes button a few times, that's usually what I do. And I do avoid using that extension.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Background bitmap causes python extension to crash?

Postby tylerdurden » Fri Aug 07, 2015 10:04 am

brynn wrote:By the way, when you say
The bitmap is about 5000px by 4000px so I don't know why it is choking.

you seem to think that's a small image. But it seems quite large to me! Doing some very rough calculations, that must be approx 4 feet by 3 feet.


Printed at 600dpi, more like 8.5" x 6.5"...
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Background bitmap causes python extension to crash?

Postby Lazur » Fri Aug 07, 2015 10:37 am

tylerdurden wrote:Printed at 600dpi, more like 8.5" x 6.5"...


Off topic:
While others only problem is the preview not showing up bitmap tracing an A2+ sized image @ 600 dpi.

The detail level is heavily related to the performance, and the number of scans too...
still I have doubts if the result would add much to the overall look with the trace bitmap.



For a similar result as with the add nodes extension, you can try the pattern along path lpe.
By using a two noded straight horizontal path, linked for the effect, you can adjust the distance between the nodes on the core path a bit (repeated, stretched settings) .
Then convert object to path, and merge double nodes.

Greengoat
Posts: 2
Joined: Fri Aug 07, 2015 6:08 am

Re: Background bitmap causes python extension to crash?

Postby Greengoat » Sat Aug 08, 2015 2:56 am

Thanks for the solution folks. I guess it is odd, but this is the first time I have had to actually add nodes in a project in Inkscape and I thought the Add Nodes extension was the main way to do it. Thanks for the other two solutions.

Like tyler says, the bitmap size is straight from an anticipated printed map, so it has a detailed resolution to work from. My comment was on memory size for that resolution since my linux setup is rigged with RAM to do big graphic files.

I will give the other two methods a shot.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Background bitmap causes python extension to crash?

Postby brynn » Sat Aug 08, 2015 6:36 am

tylerdurden wrote:
brynn wrote:By the way, when you say
The bitmap is about 5000px by 4000px so I don't know why it is choking.

you seem to think that's a small image. But it seems quite large to me! Doing some very rough calculations, that must be approx 4 feet by 3 feet.


Printed at 600dpi, more like 8.5" x 6.5"...


Ah yes! DPI notwithstanding.


Return to “Discuss Software Issues”