[gimp/gimp-2-10] plug-ins: in metadata-viewer improve how we show XMP tags.



commit 3150f08a0a1b18f96e32a322ebbf2397097880df
Author: Jacob Boerema <jgboerema gmail com>
Date:   Fri Sep 24 15:22:49 2021 -0400

    plug-ins: in metadata-viewer improve how we show XMP tags.
    
    XMP tags that have multiple values (usually of type XMpBag or XmpSeq) were
    shown on one line. Which, especially for long text values, could make it
    difficult to see the separate values for that tag.
    
    Let's do the same as we do for IPTC tags that can occur multiple times and
    show each value on a separate line.
    
    (cherry picked from commit baaa1380cfc5659ad673f1540d61b027df4bac49)

 plug-ins/metadata/metadata-viewer.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/plug-ins/metadata/metadata-viewer.c b/plug-ins/metadata/metadata-viewer.c
index e12f30e8e6..59719aa366 100644
--- a/plug-ins/metadata/metadata-viewer.c
+++ b/plug-ins/metadata/metadata-viewer.c
@@ -597,12 +597,23 @@ metadata_dialog_append_tags (GExiv2Metadata  *metadata,
         }
       else
         {
-          value = metadata_dialog_format_tag_value (metadata, tag,
-                                                    /* truncate = */ TRUE);
-          metadata_dialog_add_tag (store, iter,
-                                   tag_column, value_column,
-                                   tag, value);
-          g_free (value);
+          if (g_str_has_prefix (tag, "Xmp.") &&
+              g_strcmp0 (gexiv2_metadata_get_tag_type (tag), "XmpText") != 0)
+            {
+              metadata_dialog_add_multiple_values (GEXIV2_METADATA (metadata),
+                                                   tag, store,
+                                                   tag_column,
+                                                   value_column);
+            }
+          else
+            {
+              value = metadata_dialog_format_tag_value (metadata, tag,
+                                                        /* truncate = */ TRUE);
+              metadata_dialog_add_tag (store, iter,
+                                       tag_column, value_column,
+                                       tag, value);
+              g_free (value);
+            }
         }
     }
 }


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