GNOME Bugzilla – Bug 322067
a simple script to stroke all paths breaks when stroking an empty path
Last modified: 2005-11-22 17:55:02 UTC
The script I wrote is in python, I do not think it is a python bug though. It is a combination of how importing paths work and this script that strokes all paths that caused gimp to crash spewing this message over and over again: (gimp:15974): Gimp-Core-CRITICAL **: gimp_image_undo: assertion `gimage->pushing_undo_group == GIMP_UNDO_GROUP_NONE' failed To import an SVG, you must have at least one path (even an empty path) existing in the image. While making the image that triggered this crash, I imported the Wilber.svg to the image and forgot about the empty New path I used to import it with. My script uses the current brush to stroke all paths or stroke all visible paths. When the gimp tries to stroke the empty path the activity of the script stops and I get this error: Traceback (most recent call last):
+ Trace 64175
res = _interact(func_name, start_params)
return run_script([])
return apply(function, params)
image_paths_brushstroke(image, drawable, visible_only)
pdb.gimp_path_stroke_current(image)
(the line numbers here will not match the line numbers of the script i am attaching....) Simply deleting the empty path will allow the script to gracefully finish its task. Edit-->Undo from this point will crash poor GIMP with that critical error I pasted earlier. Allowing paths to be imported when no paths are present would fix one part of this problem. GIMP gracefully just reporting that there is an empty path present instead of stopping while stroking would fix other potential future problems I will attach this simple script, it is very easy to trigger this bug with it.
Created attachment 55045 [details] path stroking python script
Just out of curiosity, why would you need a path in the image before you can import another path?
no way to get the menu. did you try it?
okay i am wrong. you can import a path without a path existing. it would be nice if an empty path did not break gimp so easily though.
Doesn't crash gimp here. I agree that GIMP shouldn't choke on an empty path and we should probably change that operation to silently do nothing (isn't that the expected behaviour anyway?).
2005-11-22 Sven Neumann <sven@gimp.org> * app/vectors/gimpvectors.c (gimp_vectors_stroke): return successfully when stroking an empty path. Fixes bug #322067.