[gimp/metadata-browser: 30/45] Serialize XMP_TYPE_TEXT values correctly.



commit deaf61f332e82faf229a4acdc0628be14d87f2a2
Author: Roman Joost <roman bromeco de>
Date:   Thu Sep 29 13:53:49 2011 +1000

    Serialize XMP_TYPE_TEXT values correctly.
    
    The description writer is a XMP_TYPE_TEXT property, which should be
    serialized correctly._

 plug-ins/metadata/tests/files/test.xmp             |    4 ++++
 .../metadata/tests/test-xmp-model-functional.c     |    7 ++++---
 plug-ins/metadata/xmp-encode.c                     |    4 +++-
 3 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/metadata/tests/files/test.xmp b/plug-ins/metadata/tests/files/test.xmp
index 7ff6369..b61eb38 100644
--- a/plug-ins/metadata/tests/files/test.xmp
+++ b/plug-ins/metadata/tests/files/test.xmp
@@ -21,6 +21,10 @@
   </dc:description>
  </rdf:Description>
 
+ <rdf:Description rdf:about=""
+   xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/";>
+   <photoshop:CaptionWriter>Description Writer</photoshop:CaptionWriter>
+ </rdf:Description>
 </rdf:RDF>
 </x:xmpmeta>
 <?xpacket end='r'?>
diff --git a/plug-ins/metadata/tests/test-xmp-model-functional.c 
b/plug-ins/metadata/tests/test-xmp-model-functional.c
index e24f862..74d0fad 100644
--- a/plug-ins/metadata/tests/test-xmp-model-functional.c
+++ b/plug-ins/metadata/tests/test-xmp-model-functional.c
@@ -49,9 +49,10 @@ typedef struct
 
 static TestDataEntry propertiestotest[] =
 {
-   { "dc",  "title",       1 },
-   { "dc",  "creator",     0 },
-   { "dc",  "description", 1 },
+   { XMP_PREFIX_DUBLIN_CORE,  "title",          1 },
+   { XMP_PREFIX_DUBLIN_CORE,  "creator",        0 },
+   { XMP_PREFIX_DUBLIN_CORE,  "description",    1 },
+   { XMP_PREFIX_PHOTOSHOP,    "CaptionWriter",  0 },
    { NULL,  NULL,          0 }
 };
 TestDataEntry * const import_exportdata = propertiestotest;
diff --git a/plug-ins/metadata/xmp-encode.c b/plug-ins/metadata/xmp-encode.c
index 6af1d28..daeac16 100644
--- a/plug-ins/metadata/xmp-encode.c
+++ b/plug-ins/metadata/xmp-encode.c
@@ -122,7 +122,9 @@ gen_property (GString            *buffer,
     case XMP_TYPE_TEXT:
     case XMP_TYPE_RATIONAL:
       gen_element (buffer, 2,
-                   schema->prefix, property->name, value_array[0],
+                   schema->prefix,
+                   property->name,
+                   (value != NULL) ? value : value_array[0],
                    NULL);
       break;
 


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