After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 322067 - a simple script to stroke all paths breaks when stroking an empty path
a simple script to stroke all paths breaks when stroking an empty path
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other Linux
: Normal normal
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-11-21 19:48 UTC by Carol
Modified: 2005-11-22 17:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
path stroking python script (2.18 KB, text/x-python)
2005-11-21 19:50 UTC, Carol
Details

Description Carol 2005-11-21 19:48:46 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):
  • File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 621 in _run
    res = _interact(func_name, start_params)
  • File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 267 in _interact
    return run_script([])
  • File "/usr/local/lib/gimp/2.0/python/gimpfu.py", line 263 in run_script
    return apply(function, params)
  • File "/home/carol/.gimp-2.3/plug-ins/paths.py", line 96 in image_paths_brushstroke_all
    image_paths_brushstroke(image, drawable, visible_only)
  • File "/home/carol/.gimp-2.3/plug-ins/paths.py", line 90 in image_paths_brushstroke
    pdb.gimp_path_stroke_current(image)
RuntimeError: execution error

(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.
Comment 1 Carol 2005-11-21 19:50:03 UTC
Created attachment 55045 [details]
path stroking python script
Comment 2 Sven Neumann 2005-11-22 12:22:27 UTC
Just out of curiosity, why would you need a path in the image before you can
import another path?
Comment 3 Carol 2005-11-22 13:57:59 UTC
no way to get the menu.

did you try it?
Comment 4 Carol 2005-11-22 14:00:56 UTC
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.
Comment 5 Sven Neumann 2005-11-22 17:48:51 UTC
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?).
Comment 6 Sven Neumann 2005-11-22 17:55:02 UTC
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.