GNOME Bugzilla – Bug 767662
MyPaint Brush with parse error aborts GIMP
Last modified: 2016-12-07 16:40:59 UTC
Created attachment 329816 [details] A set with a unique brush - By AnTi When you are using the same Brush Folder to MyPaint and GIMP Git Master, and after the installation of GIMP you try add (via import) a new set on MyPaint, it produces: $:/opt/gimp-default-master/bin$ ./gimp-2.9 This is a development version of GIMP. Debug messages may appear here. gimp-2.9: mypaint-brush.c:239: mypaint_brush_set_base_value: Assertion `id >= 0 && id < MYPAINT_BRUSH_SETTINGS_COUNT' failed. ./gimp-2.9: terminated: Aborted --- Steps After installation GIMP see all brushes in the default MyPaint Brush folder; Open GIMP and to share the folder of brushes on the GIMP preferences; Open MyPaint and import a new brush set (attachment, e.g, spottedBrush.zip); Open again GIMP via terminal... The GIMP git master commit 8ac1e40 DE Gnome 3.10 - ubuntu gnome 14.04.2
I have update the clone of libmypaint 1.3, recompiled and the last 1.3 beta has the same behavior.
Indeed, this is very broken. Most importantly, libmypaint must not abort on a parse error.
libmypain aborts when GIMP calls mypaint_brush_from_string(), it should simply return FALSE. A new function with a descriptive GError would also be nice :)
Yeah, it shouldn't break like that. Note that MyPaint itself doesn't construct brushes this way: it parses the JSON in Python code and pokes all brush settings itself. For historical reasons, and because we use some slots for string fields. The libmypaint tracker is https://github.com/mypaint/libmypaint/issues
Looks like someone ended up filing an issue in your tracker, Andrew: https://github.com/mypaint/libmypaint/issues/74 :) Unfortunately it's a blocker for us :(
Okay, work in progress upstream to deal with it. I've proposed a patch for it, and I will merge it tomorrow unless anyone has any major objections to the approach. One thing that may be surprising: in the test branch, if mypaint_brush_from_string() doesn't recognise a setting code it will ignore that setting, continue on, and still return success. Errors, and failed loads, are associated with major structural things like settings blocks missing entirely or wrong/incompatible versions.
Fixed upstream on master. Please can you re-test? You should be able to throw some fairly broken data at the json loader now and make it just shrug at you.
I have updated GIMP GIT Master (gimp, gegl, babl and libmypaint) > commit 7642cdf. Distro and DE: ubuntu gnome 14.04.2, Gnome 3.10 --- So, testing with same set brush, attached in this bug report, isn't producing crash, the unique message on my terminal it seems relative to .myb: This is a development version of GIMP. Debug messages may appear here. Warning: Unknown setting_id: -1 for setting: offset_angle Warning: Unknown setting_id: -1 for setting: offset_angle_2 Warning: Unknown setting_id: -1 for setting: offset_x Warning: Unknown setting_id: -1 for setting: offset_y
Thanks a lot Andrew for fixing and Jose for testing! Will close this report as soon as we can depend on the new libmypaint release.
libmypaint 1.3.0 has been released. Actually it turns out we are already depending on this release since master was previously depending on the 1.3.0 beta version, which had the same release number in pkg-config. So anyway we can't differentiate in our `configure` script. Let's just close and rightly assume that any distribution will publish the stable 1.3.0 version only, not the beta. :-)
Let's not hide this from lists of fixed, NEWS-worthy bugs.