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 767662 - MyPaint Brush with parse error aborts GIMP
MyPaint Brush with parse error aborts GIMP
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Data
git master
Other All
: Normal critical
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2016-06-14 18:33 UTC by jose americo gobbo
Modified: 2016-12-07 16:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A set with a unique brush - By AnTi (42.24 KB, application/zip)
2016-06-14 18:33 UTC, jose americo gobbo
Details

Description jose americo gobbo 2016-06-14 18:33:04 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
Comment 1 jose americo gobbo 2016-06-15 00:16:47 UTC
I have update the clone of libmypaint 1.3, recompiled and the last 1.3 beta has the same behavior.
Comment 2 Michael Natterer 2016-06-15 10:27:27 UTC
Indeed, this is very broken. Most importantly, libmypaint must not
abort on a parse error.
Comment 3 Michael Natterer 2016-06-15 10:47:33 UTC
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 :)
Comment 4 Andrew Chadwick 2016-06-15 11:09:52 UTC
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
Comment 5 Alexandre Prokoudine 2016-10-30 22:20:27 UTC
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 :(
Comment 6 Andrew Chadwick 2016-11-29 22:28:46 UTC
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.
Comment 7 Andrew Chadwick 2016-12-01 04:42:38 UTC
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.
Comment 8 jose americo gobbo 2016-12-01 11:04:23 UTC
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
Comment 9 Michael Natterer 2016-12-01 11:18:40 UTC
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.
Comment 10 Jehan 2016-12-02 11:17:10 UTC
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. :-)
Comment 11 Michael Schumacher 2016-12-07 16:40:59 UTC
Let's not hide this from lists of fixed, NEWS-worthy bugs.