[gimp/metadata-browser: 2/44] Revert "Default XMP_TYPE_LANG_ALT to "x-default" according to spec."



commit 4580d14f505e50fd01ff0c1524c46cb009a5f07b
Author: Roman Joost <roman bromeco de>
Date:   Thu Sep 1 20:29:43 2011 +1000

    Revert "Default XMP_TYPE_LANG_ALT to "x-default" according to spec."
    
    This reverts commit a4ccfcee72e13228ced79185d1116c846df63892, because
    the encoder needs to generate XMP data with attributes and their
    language code if they're set in the model. This commit was hiding the
    problem, that the xmp_model_entry widgets changed the raw value in the
    tree model and set a wrong type of value therefore overwriting important
    data.

 plug-ins/metadata/xmp-encode.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/metadata/xmp-encode.c b/plug-ins/metadata/xmp-encode.c
index fc6464d..76d5617 100644
--- a/plug-ins/metadata/xmp-encode.c
+++ b/plug-ins/metadata/xmp-encode.c
@@ -159,10 +159,13 @@ gen_property (GString            *buffer,
     case XMP_TYPE_LANG_ALT:
       g_string_append_printf (buffer, "  <%s:%s>\n   <rdf:Alt>\n",
                               schema->prefix, property->name);
-      gen_element (buffer, 4,
-                   "rdf", "li", value_array[0],
-                   "xml:lang", "x-default",
-                   NULL);
+      for (i = 0; value_array[i] != NULL; i += 2)
+        {
+          gen_element (buffer, 4,
+                       "rdf", "li", value_array[i + 1],
+                       "xml:lang", value_array[i],
+                       NULL);
+        }
       g_string_append_printf (buffer, "   </rdf:Alt>\n  </%s:%s>\n",
                               schema->prefix, property->name);
       break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]