libgimp: more un-deprecating GExiv2.

Last deprecated usages in this file. Actually there are a few other
calls but deprecated on GExiv2 0.14.0, hence over our current
requirement. So we'll have to handle these later.
This commit is contained in:
Jehan 2022-01-20 18:43:36 +01:00
parent 0d33ede670
commit c76172d971
1 changed files with 18 additions and 3 deletions

View File

@ -345,7 +345,7 @@ gimp_image_metadata_copy_tag (GExiv2Metadata *src,
GExiv2Metadata *dest,
const gchar *tag)
{
gchar **values = gexiv2_metadata_get_tag_multiple (src, tag);
gchar **values = gexiv2_metadata_try_get_tag_multiple (src, tag, NULL);
GError *error = NULL;
if (values)
@ -359,13 +359,22 @@ gimp_image_metadata_copy_tag (GExiv2Metadata *src,
temp_tag = g_strdup (tag);
g_debug ("Copy multi tag %s, first value: %s", temp_tag, values[0]);
gexiv2_metadata_set_tag_multiple (dest, temp_tag, (const gchar **) values);
gexiv2_metadata_try_set_tag_multiple (dest, temp_tag,
(const gchar **) values,
&error);
if (error)
{
g_warning ("%s: failed to set multiple metadata '%s': %s\n",
G_STRFUNC, tag, error->message);
g_clear_error (&error);
}
g_free (temp_tag);
g_strfreev (values);
}
else
{
gchar *value = gexiv2_metadata_get_tag_string (src, tag);
gchar *value = gexiv2_metadata_try_get_tag_string (src, tag, &error);
if (value)
{
@ -379,6 +388,12 @@ gimp_image_metadata_copy_tag (GExiv2Metadata *src,
}
g_free (value);
}
else if (error)
{
g_warning ("%s: failed to get metadata '%s': %s\n",
G_STRFUNC, tag, error->message);
g_clear_error (&error);
}
}
}