[gimp/metadata-browser] Serialize values if no raw data is set.
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] Serialize values if no raw data is set.
- Date: Wed, 28 Sep 2011 10:54:18 +0000 (UTC)
commit 658e1a865f21e93446373fa3a3ffe42db171b0df
Author: Roman Joost <roman bromeco de>
Date: Wed Sep 28 20:06:23 2011 +1000
Serialize values if no raw data is set.
Correctly serialize XMP Metadata in case the user creates an empty image
and attaches metadata to it.
plug-ins/metadata/xmp-encode.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/metadata/xmp-encode.c b/plug-ins/metadata/xmp-encode.c
index 9b98f6f..a1b6039 100644
--- a/plug-ins/metadata/xmp-encode.c
+++ b/plug-ins/metadata/xmp-encode.c
@@ -267,6 +267,7 @@ xmp_generate_packet (XMPModel *xmp_model,
GtkTreeIter child;
const XMPSchema *schema;
gpointer saved_ref;
+ const gchar *saved_value;
g_return_if_fail (xmp_model != NULL);
g_return_if_fail (buffer != NULL);
@@ -291,6 +292,7 @@ xmp_generate_packet (XMPModel *xmp_model,
if (gtk_tree_model_iter_children (model, &child, &iter))
{
saved_ref = NULL;
+ saved_value = NULL;
do
{
const XMPProperty *property;
@@ -303,9 +305,11 @@ xmp_generate_packet (XMPModel *xmp_model,
COL_XMP_VALUE_RAW, &value_array,
-1);
/* do not process structured types multiple times */
- if (saved_ref != value_array)
+ if (saved_ref != value_array
+ || (value != NULL && saved_value != value))
{
saved_ref = value_array;
+ saved_value = value;
g_return_if_fail (property->name != NULL);
gen_property (buffer, schema, property, value, value_array);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]