app: do not raise a warning when failing to deserialize symmetry...

... parasite.
Not sure if that should be considered a bug. On one hand, it should
because that's core code. On the other hand, symmetry saving currently
uses parasites, which is a feature which can also be used by people
randomly. So "theoretically", there could be any data in a parasite and
we should not assume specific format.
Anyway still keep the error message but just print to standard error
output instead. Also print a bit more details (parasite name and
contents) as it would help for debugging when such a case were to occur.
This commit is contained in:
Jehan 2018-04-01 18:16:54 +02:00
parent e0029d31b4
commit c9df2a6879
1 changed files with 4 additions and 2 deletions

View File

@ -428,7 +428,6 @@ gimp_symmetry_from_parasite (const GimpParasite *parasite,
g_return_val_if_fail (strcmp (gimp_parasite_name (parasite),
parasite_name) == 0,
NULL);
g_free (parasite_name);
str = gimp_parasite_data (parasite);
g_return_val_if_fail (str != NULL, NULL);
@ -445,12 +444,15 @@ gimp_symmetry_from_parasite (const GimpParasite *parasite,
NULL,
&error))
{
g_warning ("Failed to deserialize symmetry parasite: %s", error->message);
g_printerr ("Failed to deserialize symmetry parasite: %s\n"
"\t- parasite name: %s\n\t- parasite data: %s\n",
error->message, parasite_name, str);
g_error_free (error);
g_object_unref (symmetry);
symmetry = NULL;
}
g_free (parasite_name);
if (symmetry)
{