[gimp/gimp-2-10] plug-ins: clean all warnings on metadata plug-in.



commit 03b78e97d07d86fa3042a038939853539a648c9c
Author: Jehan <jehan girinstud io>
Date:   Wed Nov 6 14:18:13 2019 +0100

    plug-ins: clean all warnings on metadata plug-in.
    
    I made the various static arrays in headers declared as extern and
    defined in a separate implementation file, with additional size constant
    when necessary (since G_N_ELEMENTS() cannot be used on partially
    defined arrays).
    
    Note that this is better than the original implementation, yet I am not
    saying this is ideal either. I am not fond of such code organization and
    think a better one could be done. But it would require to dive deeper
    into this plug-in and I don't want to right now, nor have the time.
    
    At least now it stopped shouting all these warnings!
    
    (cherry picked from commit 31cbc7e0e6672cca38c3742cfd315a5cce0696b1)

 plug-ins/metadata/Makefile.am       |   1 +
 plug-ins/metadata/metadata-editor.c |  40 ++--
 plug-ins/metadata/metadata-impexp.c |   4 +-
 plug-ins/metadata/metadata-tags.c   | 408 ++++++++++++++++++++++++++++++++++++
 plug-ins/metadata/metadata-tags.h   | 349 +++++-------------------------
 plug-ins/metadata/metadata-xml.c    |  18 +-
 6 files changed, 490 insertions(+), 330 deletions(-)
---
diff --git a/plug-ins/metadata/Makefile.am b/plug-ins/metadata/Makefile.am
index 8133193f7d..d7be32fe91 100644
--- a/plug-ins/metadata/Makefile.am
+++ b/plug-ins/metadata/Makefile.am
@@ -34,6 +34,7 @@ metadata_editor_SOURCES = \
        metadata-impexp.c       \
        metadata-impexp.h       \
        metadata-misc.h         \
+       metadata-tags.c         \
        metadata-tags.h         \
        metadata-xml.c          \
        metadata-xml.h
diff --git a/plug-ins/metadata/metadata-editor.c b/plug-ins/metadata/metadata-editor.c
index 6360621707..289fedc72f 100644
--- a/plug-ins/metadata/metadata-editor.c
+++ b/plug-ins/metadata/metadata-editor.c
@@ -1510,7 +1510,7 @@ metadata_dialog_editor_set_metadata (GExiv2Metadata *metadata,
   gchar     *value;
   gint       i;
 
-  gint32 numele = G_N_ELEMENTS (default_metadata_tags);
+  gint32 numele = n_default_metadata_tags;
 
   /* Setup Buttons */
   button_widget = builder_get_widget (builder, "add_licensor_button");
@@ -3075,11 +3075,11 @@ metadata_dialog_editor_set_metadata (GExiv2Metadata *metadata,
 
                   counter = count_tags (metadata, LICENSOR_HEADER,
                                         licensor,
-                                        G_N_ELEMENTS (licensor));
+                                        n_licensor);
 
                   get_tags (metadata, LICENSOR_HEADER,
                             licensor,
-                            G_N_ELEMENTS (licensor), counter);
+                            n_licensor, counter);
 
                   phonestore = gtk_list_store_new (1, G_TYPE_STRING);
                   gtk_list_store_append (phonestore, &phoneiter);
@@ -3347,11 +3347,11 @@ metadata_dialog_editor_set_metadata (GExiv2Metadata *metadata,
 
                   counter = count_tags (metadata, COPYRIGHTOWNER_HEADER,
                                         copyrightowner,
-                                        G_N_ELEMENTS (copyrightowner));
+                                        n_copyrightowner);
 
                   get_tags (metadata, COPYRIGHTOWNER_HEADER,
                             copyrightowner,
-                            G_N_ELEMENTS (copyrightowner), counter);
+                            n_copyrightowner, counter);
 
                   treemodel = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
                   liststore = GTK_LIST_STORE (treemodel);
@@ -3439,11 +3439,11 @@ metadata_dialog_editor_set_metadata (GExiv2Metadata *metadata,
 
                   counter = count_tags (metadata, IMAGECREATOR_HEADER,
                                         imagecreator,
-                                        G_N_ELEMENTS (imagecreator));
+                                        n_imagecreator);
 
                   get_tags (metadata, IMAGECREATOR_HEADER,
                             imagecreator,
-                            G_N_ELEMENTS (imagecreator), counter);
+                            n_imagecreator, counter);
 
                   treemodel = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
                   liststore = GTK_LIST_STORE (treemodel);
@@ -3531,11 +3531,11 @@ metadata_dialog_editor_set_metadata (GExiv2Metadata *metadata,
 
                   counter = count_tags (metadata, ARTWORKOROBJECT_HEADER,
                                         artworkorobject,
-                                        G_N_ELEMENTS (artworkorobject));
+                                        n_artworkorobject);
 
                   get_tags (metadata, ARTWORKOROBJECT_HEADER,
                             artworkorobject,
-                            G_N_ELEMENTS (artworkorobject), counter);
+                            n_artworkorobject, counter);
 
                   treemodel = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
                   liststore = GTK_LIST_STORE (treemodel);
@@ -3734,11 +3734,11 @@ metadata_dialog_editor_set_metadata (GExiv2Metadata *metadata,
 
                   counter = count_tags (metadata, REGISTRYID_HEADER,
                                         registryid,
-                                        G_N_ELEMENTS (registryid));
+                                        n_registryid);
 
                   get_tags (metadata, REGISTRYID_HEADER,
                             registryid,
-                            G_N_ELEMENTS (registryid), counter);
+                            n_registryid, counter);
 
                   treemodel = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
                   liststore = GTK_LIST_STORE (treemodel);
@@ -3826,11 +3826,11 @@ metadata_dialog_editor_set_metadata (GExiv2Metadata *metadata,
 
                   counter = count_tags (metadata, LOCATIONSHOWN_HEADER,
                                         locationshown,
-                                        G_N_ELEMENTS (locationshown));
+                                        n_locationshown);
 
                   get_tags (metadata, LOCATIONSHOWN_HEADER,
                             locationshown,
-                            G_N_ELEMENTS (locationshown), counter);
+                            n_locationshown, counter);
 
                   treemodel = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
                   liststore = GTK_LIST_STORE (treemodel);
@@ -4502,7 +4502,7 @@ metadata_editor_write_callback (GtkWidget  *dialog,
     {
       gint item;
 
-      for (item = 0; item < G_N_ELEMENTS (locationshown); item++)
+      for (item = 0; item < n_locationshown; item++)
         {
           g_snprintf (tag, sizeof (tag), "%s[%d]%s",
                      LOCATIONSHOWN_HEADER, row, locationshown[item]);
@@ -4604,7 +4604,7 @@ metadata_editor_write_callback (GtkWidget  *dialog,
     {
       gint item;
 
-      for (item = 0; item < G_N_ELEMENTS (artworkorobject); item++)
+      for (item = 0; item < n_artworkorobject; item++)
         {
           g_snprintf (tag, sizeof (tag), "%s[%d]%s",
                       ARTWORKOROBJECT_HEADER, row, artworkorobject[item]);
@@ -4708,7 +4708,7 @@ metadata_editor_write_callback (GtkWidget  *dialog,
     {
       gint item;
 
-      for (item = 0; item < G_N_ELEMENTS (registryid); item++)
+      for (item = 0; item < n_registryid; item++)
         {
           g_snprintf (tag, sizeof (tag), "%s[%d]%s",
                       REGISTRYID_HEADER, row, registryid[item]);
@@ -4772,7 +4772,7 @@ metadata_editor_write_callback (GtkWidget  *dialog,
     {
       gint item;
 
-      for (item = 0; item < G_N_ELEMENTS (imagecreator); item++)
+      for (item = 0; item < n_imagecreator; item++)
         {
           g_snprintf (tag, sizeof (tag), "%s[%d]%s",
                       IMAGECREATOR_HEADER, row, imagecreator[item]);
@@ -4836,7 +4836,7 @@ metadata_editor_write_callback (GtkWidget  *dialog,
     {
       gint item;
 
-      for (item = 0; item < G_N_ELEMENTS (copyrightowner); item++)
+      for (item = 0; item < n_copyrightowner; item++)
         {
           g_snprintf (tag, sizeof (tag), "%s[%d]%s",
                       COPYRIGHTOWNER_HEADER, row, copyrightowner[item]);
@@ -4900,7 +4900,7 @@ metadata_editor_write_callback (GtkWidget  *dialog,
     {
       gint item;
 
-      for (item = 0; item < G_N_ELEMENTS (licensor); item++)
+      for (item = 0; item < n_licensor; item++)
         {
           g_snprintf (tag, sizeof (tag), "%s[%d]%s",
                       LICENSOR_HEADER, row, licensor[item]);
@@ -5107,7 +5107,7 @@ metadata_editor_write_callback (GtkWidget  *dialog,
         }
     }
 
-  max_elements = G_N_ELEMENTS (default_metadata_tags);
+  max_elements = n_default_metadata_tags;
 
   for (i = 0; i < max_elements; i++)
     {
diff --git a/plug-ins/metadata/metadata-impexp.c b/plug-ins/metadata/metadata-impexp.c
index a0dc7334f7..8cf6fc7581 100644
--- a/plug-ins/metadata/metadata-impexp.c
+++ b/plug-ins/metadata/metadata-impexp.c
@@ -119,7 +119,7 @@ export_file_metadata (metadata_editor *args)
                          "<gimp-metadata>\n", NULL);
 
   /* HANDLE IPTC */
-  for (i = 0; i < G_N_ELEMENTS (equivalent_metadata_tags); i++)
+  for (i = 0; i < n_equivalent_metadata_tags; i++)
     {
       int index = equivalent_metadata_tags[i].other_tag_index;
       xmldata = g_strconcat (xmldata, "\t<iptc-tag>\n", NULL);
@@ -165,7 +165,7 @@ export_file_metadata (metadata_editor *args)
     }
 
   /* HANDLE XMP */
-  for (i = 0; i < G_N_ELEMENTS (default_metadata_tags); i++)
+  for (i = 0; i < n_default_metadata_tags; i++)
     {
       xmldata = g_strconcat (xmldata, "\t<xmp-tag>\n", NULL);
       xmldata = g_strconcat (xmldata, "\t\t<tag-name>", NULL);
diff --git a/plug-ins/metadata/metadata-tags.c b/plug-ins/metadata/metadata-tags.c
new file mode 100644
index 0000000000..89f83b29ad
--- /dev/null
+++ b/plug-ins/metadata/metadata-tags.c
@@ -0,0 +1,408 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gexiv2/gexiv2.h>
+#include <glib.h>
+#include <gtk/gtk.h>
+
+#include <libgimp/gimp.h>
+#include "libgimp/stdplugins-intl.h"
+
+#include "metadata-tags.h"
+
+
+const metadata_tag default_metadata_tags[] =
+{
+  /* Description */
+  { "Xmp.dc.title",                              "single", 16,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  0
+  { "Xmp.dc.creator",                            "single", 13,  TAG_TYPE_XMP, GIMP_XMP_SEQ   }, //  1
+  { "Xmp.dc.description",                        "multi",  14,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  2
+  { "Xmp.dc.subject",                            "multi",  15,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, //  3
+  { "Xmp.dc.rights",                             "single", 17,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  4
+  { "Xmp.photoshop.AuthorsPosition",             "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  5
+  { "Xmp.photoshop.CaptionWriter",               "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  6
+  { "Xmp.xmp.Rating",                            "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, //  7
+  { "Xmp.xmpRights.Marked",                      "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, //  8
+  { "Xmp.xmpRights.WebStatement",                "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  9
+
+  /* IPTC */
+  { "Xmp.photoshop.DateCreated",                 "single",  0,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 10
+  { "Xmp.photoshop.Headline",                    "multi",   3,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 11
+  { "Xmp.photoshop.TransmissionReference",       "single",  1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 12
+  { "Xmp.photoshop.Instructions",                "multi",   2,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 13
+  { "Xmp.iptc.IntellectualGenre",                "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 14
+  { "Xmp.iptc.Scene",                            "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, // 15
+  { "Xmp.iptc.Location",                         "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 16
+  { "Xmp.iptc.CountryCode",                      "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 17
+  { "Xmp.iptc.SubjectCode",                      "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, // 18
+  { "Xmp.xmpRights.UsageTerms",                  "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 19
+  { "Xmp.photoshop.City",                        "single",  5,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 20
+  { "Xmp.photoshop.State",                       "single",  6,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 21
+  { "Xmp.photoshop.Country",                     "single",  7,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 22
+  { "Xmp.photoshop.CaptionWriter",               "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 23
+  { "Xmp.photoshop.Credit",                      "single",  8,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 24
+  { "Xmp.photoshop.Source",                      "single",  9,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 25
+  { "Xmp.photoshop.Urgency",                     "combo",  11,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 26
+
+  /* IPTC Extension */
+  { "Xmp.iptcExt.PersonInImage",                 "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, // 27
+  { "Xmp.iptcExt.Sublocation",                   "single", 12,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 28
+  { "Xmp.iptcExt.City",                          "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 29
+  { "Xmp.iptcExt.ProvinceState",                 "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 30
+  { "Xmp.iptcExt.CountryName",                   "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 31
+  { "Xmp.iptcExt.CountryCode",                   "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 32
+  { "Xmp.iptcExt.WorldRegion",                   "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 33
+  { "Xmp.iptcExt.LocationShown",                 "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 34
+  { "Xmp.iptcExt.OrganisationInImageName",       "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 35
+  { "Xmp.iptcExt.OrganisationInImageCode",       "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 36
+  { "Xmp.iptcExt.Event",                         "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 37
+  { "Xmp.iptcExt.RegistryId",                    "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 38
+  { "Xmp.iptcExt.ArtworkOrObject",               "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 39
+  { "Xmp.iptcExt.AddlModelInfo",                 "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 40
+  { "Xmp.iptcExt.ModelAge",                      "single", -1,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, // 41
+  { "Xmp.iptcExt.MaxAvailWidth",                 "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 42
+  { "Xmp.iptcExt.MaxAvailHeight",                "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 43
+  { "Xmp.iptcExt.DigitalSourceType",             "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 44
+  { "Xmp.plus.MinorModelAgeDisclosure",          "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 45
+  { "Xmp.plus.ModelReleaseStatus",               "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 46
+  { "Xmp.plus.ModelReleaseID",                   "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 47
+  { "Xmp.plus.ImageSupplierName",                "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 48
+  { "Xmp.plus.ImageSupplierID",                  "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 49
+  { "Xmp.plus.ImageSupplierImageID",             "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 50
+  { "Xmp.plus.ImageCreator",                     "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 51
+  { "Xmp.plus.CopyrightOwner",                   "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 52
+  { "Xmp.plus.Licensor",                         "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 53
+  { "Xmp.plus.PropertyReleaseStatus",            "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 54
+  { "Xmp.plus.PropertyReleaseID",                "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 55
+
+  /* Categories */
+  { "Xmp.photoshop.Category",                    "single",  4,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 56
+  { "Xmp.photoshop.SupplementalCategories",      "multi",  10,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, // 57
+
+  /* GPS */
+  { "Exif.GPSInfo.GPSLongitude",                 "single", -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 58
+  { "Exif.GPSInfo.GPSLongitudeRef",              "combo",  -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 59
+  { "Exif.GPSInfo.GPSLatitude",                  "single", -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 60
+  { "Exif.GPSInfo.GPSLatitudeRef",               "combo",  -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 61
+  { "Exif.GPSInfo.GPSAltitude",                  "single", -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 62
+  { "Exif.GPSInfo.GPSAltitudeRef",               "combo",  -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 63
+
+  /* DICOM */
+  { "Xmp.DICOM.PatientName",                     "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 64
+  { "Xmp.DICOM.PatientID",                       "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 65
+  { "Xmp.DICOM.PatientDOB",                      "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 66
+  { "Xmp.DICOM.PatientSex",                      "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 67
+  { "Xmp.DICOM.StudyID",                         "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 68
+  { "Xmp.DICOM.StudyPhysician",                  "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 69
+  { "Xmp.DICOM.StudyDateTime",                   "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 70
+  { "Xmp.DICOM.StudyDescription",                "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 71
+  { "Xmp.DICOM.SeriesNumber",                    "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 72
+  { "Xmp.DICOM.SeriesModality",                  "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 73
+  { "Xmp.DICOM.SeriesDateTime",                  "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 74
+  { "Xmp.DICOM.SeriesDescription",               "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 75
+  { "Xmp.DICOM.EquipmentInstitution",            "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 76
+  { "Xmp.DICOM.EquipmentManufacturer",           "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 77
+
+  /* IPTC */
+  { "Xmp.iptc.CiAdrExtadr",                      "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 78
+  { "Xmp.iptc.CiAdrCity",                        "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 79
+  { "Xmp.iptc.CiAdrRegion",                      "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 80
+  { "Xmp.iptc.CiAdrPcode",                       "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 81
+  { "Xmp.iptc.CiAdrCtry",                        "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 82
+  { "Xmp.iptc.CiTelWork",                        "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 83
+  { "Xmp.iptc.CiEmailWork",                      "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 84
+  { "Xmp.iptc.CiUrlWork",                        "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }  // 85
+
+};
+const gint n_default_metadata_tags = G_N_ELEMENTS (default_metadata_tags);
+
+const metadata_tag equivalent_metadata_tags[] =
+{
+  { "Iptc.Application2.DateCreated",             "single", 10,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  0
+  { "Iptc.Application2.TransmissionReference",   "single", 12,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  1
+  { "Iptc.Application2.SpecialInstructions",     "single", 13,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  2
+  { "Iptc.Application2.Headline",                "multi",  11,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  3
+  { "Iptc.Application2.Category",                "single", 56,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  4
+  { "Iptc.Application2.City",                    "single", 20,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  5
+  { "Iptc.Application2.ProvinceState",           "single", 21,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  6
+  { "Iptc.Application2.CountryName",             "single", 22,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  7
+  { "Iptc.Application2.Credit",                  "single", 24,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  8
+  { "Iptc.Application2.Source",                  "single", 25,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  9
+  { "Iptc.Application2.SuppCategory",            "single", 57,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 10
+  { "Iptc.Application2.Urgency",                 "combo",  26,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 11
+  { "Iptc.Application2.SubLocation",             "single", 28,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 12
+  { "Iptc.Application2.Byline",                  "single",  1,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 13
+  { "Iptc.Application2.Caption",                 "multi",   2,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 14
+  { "Iptc.Application2.Keywords",                "single",  3,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 15
+  { "Iptc.Application2.ObjectName",              "multi",   0,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 16
+  { "Iptc.Application2.Copyright",               "single",  4,  TAG_TYPE_IPTC, GIMP_XMP_NONE }  // 17
+};
+const gint n_equivalent_metadata_tags = G_N_ELEMENTS (equivalent_metadata_tags);
+
+/* Digital Source Type Combobox Items
+ * http://cv.iptc.org/newscodes/digitalsourcetype/
+ */
+const combobox_str_tag digitalsourcetype[] =
+{
+  { "http://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture";, N_("Original digital capture of a real 
life scene")    },
+  { "http://cv.iptc.org/newscodes/digitalsourcetype/negativeFilm";,   N_("Digitized from a negative on film") 
               },
+  { "http://cv.iptc.org/newscodes/digitalsourcetype/positiveFilm";,   N_("Digitized from a positive on film") 
               },
+  { "http://cv.iptc.org/newscodes/digitalsourcetype/print";,          N_("Digitized from a print on 
non-transparent medium") },
+  { "http://cv.iptc.org/newscodes/digitalsourcetype/softwareImage";,  N_("Created by software")               
               }
+};
+const gint n_digitalsourcetype = G_N_ELEMENTS (digitalsourcetype);
+
+/* Model Release Status Combobox Items
+ * http://ns.useplus.org/LDF/ldf-XMPSpecification#ModelReleaseStatus
+ */
+const combobox_str_tag modelreleasestatus[] =
+{
+  { "http://ns.useplus.org/ldf/vocab/MR-NON";, N_("None")                                 },
+  { "http://ns.useplus.org/ldf/vocab/MR-NAP";, N_("Not Applicable")                       },
+  { "http://ns.useplus.org/ldf/vocab/MR-NAP";, N_("Unlimited Model Releases")             },
+  { "http://ns.useplus.org/ldf/vocab/MR-LPR";, N_("Limited or Incomplete Model Releases") }
+};
+const gint n_modelreleasestatus = G_N_ELEMENTS (modelreleasestatus);
+
+/* Property Release Status Combobox Items
+ * http://ns.useplus.org/LDF/ldf-XMPSpecification#PropertyReleaseStatus
+ */
+const combobox_str_tag propertyreleasestatus[] =
+{
+  { "http://ns.useplus.org/ldf/vocab/PR-NON";, N_("None")                                    },
+  { "http://ns.useplus.org/ldf/vocab/PR-NAP";, N_("Not Applicable")                          },
+  { "http://ns.useplus.org/ldf/vocab/PR-NAP";, N_("Unlimited Property Releases")             },
+  { "http://ns.useplus.org/ldf/vocab/PR-LPR";, N_("Limited or Incomplete Property Releases") }
+};
+const gint n_propertyreleasestatus = G_N_ELEMENTS (propertyreleasestatus);
+
+/* Minor Model Age Disclosure Combobox Items
+ * http://ns.useplus.org/LDF/ldf-XMPSpecification#MinorModelAgeDisclosure
+ */
+const combobox_str_tag minormodelagedisclosure[] =
+{
+  { "http://ns.useplus.org/ldf/vocab/AG-UNK";, N_("Age Unknown")     },
+  { "http://ns.useplus.org/ldf/vocab/AG-A25";, N_("Age 25 or Over")  },
+  { "http://ns.useplus.org/ldf/vocab/AG-A24";, N_("Age 24")          },
+  { "http://ns.useplus.org/ldf/vocab/AG-A23";, N_("Age 23")          },
+  { "http://ns.useplus.org/ldf/vocab/AG-A22";, N_("Age 22")          },
+  { "http://ns.useplus.org/ldf/vocab/AG-A21";, N_("Age 21")          },
+  { "http://ns.useplus.org/ldf/vocab/AG-A20";, N_("Age 20")          },
+  { "http://ns.useplus.org/ldf/vocab/AG-A19";, N_("Age 19")          },
+  { "http://ns.useplus.org/ldf/vocab/AG-A18";, N_("Age 18")          },
+  { "http://ns.useplus.org/ldf/vocab/AG-A17";, N_("Age 17")          },
+  { "http://ns.useplus.org/ldf/vocab/AG-A16";, N_("Age 16")          },
+  { "http://ns.useplus.org/ldf/vocab/AG-A15";, N_("Age 15")          },
+  { "http://ns.useplus.org/ldf/vocab/AG-U14";, N_("Age 14 or Under") }
+};
+const gint n_minormodelagedisclosure = G_N_ELEMENTS (minormodelagedisclosure);
+
+/* Urgency */
+const gchar *urgency[] =
+{
+  N_("None"), N_("High"), N_("2"), N_("3"), N_("4"), N_("Normal"), N_("6"), N_("7"), N_("Low")
+};
+const gint n_urgency = G_N_ELEMENTS (urgency);
+
+/* Marked */
+const combobox_int_tag marked[] =
+{
+  { -1,     N_("Unknown")       }, // DO NOT SAVE
+  {  TRUE,  N_("Copyrighted")   }, // TRUE
+  {  FALSE, N_("Public Domain") }, // FALSE
+};
+const gint n_marked = G_N_ELEMENTS (marked);
+
+/* Phone Types */
+const combobox_str_tag phone_types[] =
+{
+  { "",                                      N_("Select a value") },
+  { "http://ns.useplus.org/ldf/vocab/work";,  N_("Work")  },
+  { "http://ns.useplus.org/ldf/vocab/cell";,  N_("Cell")  },
+  { "http://ns.useplus.org/ldf/vocab/fax";,   N_("Fax")   },
+  { "http://ns.useplus.org/ldf/vocab/home";,  N_("Home")  },
+  { "http://ns.useplus.org/ldf/vocab/pager";, N_("Pager") }
+};
+const gint n_phone_types = G_N_ELEMENTS (phone_types);
+
+/* DICOM Patient Sex
+ * http://dicomlookup.com/lookup.asp?sw=Ttable&q=C.7-1
+ * http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/XMP.html#DICOM
+ * https://dicomiseasy.blogspot.ca/2011/11/introduction-to-dicom-chapter-iii-dicom.html
+ * http://dicom.nema.org/standard.html
+ */
+const combobox_str_tag dicom[] =
+{
+  { "",        N_("Select a value") },
+  { "male",    N_("Male")    },
+  { "female",  N_("Female")  },
+  { "other",   N_("Other")   },
+};
+const gint n_dicom = G_N_ELEMENTS (dicom);
+
+/* GPS Altitude Ref */
+const gchar *gpsaltref[] =
+{
+  N_("Unknown"), N_("Above Sea Level"), N_("Below Sea Level")
+};
+const gint n_gpsaltref = G_N_ELEMENTS (gpsaltref);
+
+/* GPS Latitude Ref */
+const gchar *gpslatref[] =
+{
+  N_("Unknown"), N_("North"), N_("South")
+};
+const gint n_gpslatref = G_N_ELEMENTS (gpslatref);
+
+/* GPS Longitude Ref */
+const gchar *gpslngref[] =
+{
+  N_("Unknown"), N_("East"), N_("West")
+};
+const gint n_gpslngref = G_N_ELEMENTS (gpslngref);
+
+/* GPS Measurement System */
+const gchar *gpsaltsys[] =
+{
+  "M", "FT"
+};
+const gint n_gpsaltsys = G_N_ELEMENTS (gpsaltsys);
+
+const TranslateHeaderTag creatorContactInfoHeader =
+{
+  "Xmp.iptc.CreatorContactInfo", "type=\"Struct\"", 8
+};
+
+const TranslateTag creatorContactInfoTags[] =
+{
+  { "Xmp.iptc.CiAdrExtadr", "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrExtadr", "multi",  -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptc.CiAdrCity",   "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity",   "single", -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptc.CiAdrRegion", "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrRegion", "single", -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptc.CiAdrPcode",  "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrPcode",  "single", -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptc.CiAdrCtry",   "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCtry",   "single", -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptc.CiTelWork",   "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiTelWork",   "multi",  -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptc.CiEmailWork", "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiEmailWork", "multi",  -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptc.CiUrlWork",   "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiUrlWork",   "multi",  -1,  
TAG_TYPE_XMP }
+};
+
+const TranslateHeaderTag locationCreationInfoHeader =
+{
+  "Xmp.iptcExt.LocationCreated", "type=\"Bag\"", 6
+};
+
+const TranslateTag locationCreationInfoTags[] =
+{
+  { "Xmp.iptcExt.Sublocation",   "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:Sublocation",   "single", -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptcExt.City",          "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:City",          "single", -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptcExt.ProvinceState", "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:ProvinceState", "single", -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptcExt.CountryName",   "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:CountryName",   "single", -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptcExt.CountryCode",   "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:CountryCode",   "single", -1,  
TAG_TYPE_XMP },
+  { "Xmp.iptcExt.WorldRegion",   "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:WorldRegion",   "single", -1,  
TAG_TYPE_XMP }
+};
+
+const TranslateHeaderTag imageSupplierInfoHeader =
+{
+  "Xmp.plus.ImageSupplier", "type=\"Seq\"", 2
+};
+
+const TranslateTag imageSupplierInfoTags[] =
+{
+  { "Xmp.plus.ImageSupplierName",   "Xmp.plus.ImageSupplier[1]/plus:ImageSupplierName", "multi",  -1,  
TAG_TYPE_XMP },
+  { "Xmp.plus.ImageSupplierID",     "Xmp.plus.ImageSupplier[1]/plus:ImageSupplierID",   "single", -1,  
TAG_TYPE_XMP }
+};
+
+/* Plus and IPTC extension tags */
+
+const gchar *licensor[] =
+{
+  "/plus:LicensorName",
+  "/plus:LicensorID",
+  "/plus:LicensorTelephone1",
+  "/plus:LicensorTelephoneType1",
+  "/plus:LicensorTelephone2",
+  "/plus:LicensorTelephoneType2",
+  "/plus:LicensorEmail",
+  "/plus:LicensorURL"
+};
+const gint n_licensor = G_N_ELEMENTS (licensor);
+
+#ifdef USE_TAGS
+const gchar *imagesupplier[] =
+{
+  "/plus:ImageSupplierName",
+  "/plus:ImageSupplierID"
+};
+const gint n_imagesupplier = G_N_ELEMENTS (imagesupplier);
+#endif
+
+const gchar *imagecreator[] =
+{
+  "/plus:ImageCreatorName",
+  "/plus:ImageCreatorID"
+};
+const gint n_imagecreator = G_N_ELEMENTS (imagecreator);
+
+const gchar *copyrightowner[] =
+{
+  "/plus:CopyrightOwnerName",
+  "/plus:CopyrightOwnerID"
+};
+const gint n_copyrightowner = G_N_ELEMENTS (copyrightowner);
+
+const gchar *registryid[] =
+{
+  "/Iptc4xmpExt:RegOrgId",
+  "/Iptc4xmpExt:RegItemId"
+};
+const gint n_registryid = G_N_ELEMENTS (registryid);
+
+const gchar *artworkorobject[] =
+{
+  "/Iptc4xmpExt:AODateCreated",
+  "/Iptc4xmpExt:AOSource",
+  "/Iptc4xmpExt:AOSourceInvNo",
+  "/Iptc4xmpExt:AOTitle",
+  "/Iptc4xmpExt:AOCopyrightNotice",
+  "/Iptc4xmpExt:AOCreator"
+};
+const gint n_artworkorobject = G_N_ELEMENTS (artworkorobject);
+
+const gchar *locationshown[] =
+{
+  "/Iptc4xmpExt:Sublocation",
+  "/Iptc4xmpExt:City",
+  "/Iptc4xmpExt:ProvinceState",
+  "/Iptc4xmpExt:CountryName",
+  "/Iptc4xmpExt:CountryCode",
+  "/Iptc4xmpExt:WorldRegion"
+};
+const gint n_locationshown = G_N_ELEMENTS (locationshown);
+
+#ifdef USE_TAGS
+const gchar *locationcreated[] =
+{
+  "/Iptc4xmpExt:Sublocation",
+  "/Iptc4xmpExt:City",
+  "/Iptc4xmpExt:ProvinceState",
+  "/Iptc4xmpExt:CountryName",
+  "/Iptc4xmpExt:CountryCode",
+  "/Iptc4xmpExt:WorldRegion"
+};
+const gint n_locationcreated = G_N_ELEMENTS (locationcreated);
+#endif
diff --git a/plug-ins/metadata/metadata-tags.h b/plug-ins/metadata/metadata-tags.h
index bcc9dac4f9..38e3280bed 100644
--- a/plug-ins/metadata/metadata-tags.h
+++ b/plug-ins/metadata/metadata-tags.h
@@ -116,210 +116,47 @@ enum
   PROP_REL_NUM_COLS
 };
 
-static const metadata_tag default_metadata_tags[] =
-{
-  /* Description */
-  { "Xmp.dc.title",                              "single", 16,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  0
-  { "Xmp.dc.creator",                            "single", 13,  TAG_TYPE_XMP, GIMP_XMP_SEQ   }, //  1
-  { "Xmp.dc.description",                        "multi",  14,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  2
-  { "Xmp.dc.subject",                            "multi",  15,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, //  3
-  { "Xmp.dc.rights",                             "single", 17,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  4
-  { "Xmp.photoshop.AuthorsPosition",             "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  5
-  { "Xmp.photoshop.CaptionWriter",               "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  6
-  { "Xmp.xmp.Rating",                            "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, //  7
-  { "Xmp.xmpRights.Marked",                      "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, //  8
-  { "Xmp.xmpRights.WebStatement",                "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, //  9
-
-  /* IPTC */
-  { "Xmp.photoshop.DateCreated",                 "single",  0,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 10
-  { "Xmp.photoshop.Headline",                    "multi",   3,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 11
-  { "Xmp.photoshop.TransmissionReference",       "single",  1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 12
-  { "Xmp.photoshop.Instructions",                "multi",   2,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 13
-  { "Xmp.iptc.IntellectualGenre",                "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 14
-  { "Xmp.iptc.Scene",                            "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, // 15
-  { "Xmp.iptc.Location",                         "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 16
-  { "Xmp.iptc.CountryCode",                      "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 17
-  { "Xmp.iptc.SubjectCode",                      "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, // 18
-  { "Xmp.xmpRights.UsageTerms",                  "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 19
-  { "Xmp.photoshop.City",                        "single",  5,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 20
-  { "Xmp.photoshop.State",                       "single",  6,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 21
-  { "Xmp.photoshop.Country",                     "single",  7,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 22
-  { "Xmp.photoshop.CaptionWriter",               "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 23
-  { "Xmp.photoshop.Credit",                      "single",  8,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 24
-  { "Xmp.photoshop.Source",                      "single",  9,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 25
-  { "Xmp.photoshop.Urgency",                     "combo",  11,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 26
-
-  /* IPTC Extension */
-  { "Xmp.iptcExt.PersonInImage",                 "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, // 27
-  { "Xmp.iptcExt.Sublocation",                   "single", 12,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 28
-  { "Xmp.iptcExt.City",                          "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 29
-  { "Xmp.iptcExt.ProvinceState",                 "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 30
-  { "Xmp.iptcExt.CountryName",                   "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 31
-  { "Xmp.iptcExt.CountryCode",                   "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 32
-  { "Xmp.iptcExt.WorldRegion",                   "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 33
-  { "Xmp.iptcExt.LocationShown",                 "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 34
-  { "Xmp.iptcExt.OrganisationInImageName",       "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 35
-  { "Xmp.iptcExt.OrganisationInImageCode",       "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 36
-  { "Xmp.iptcExt.Event",                         "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 37
-  { "Xmp.iptcExt.RegistryId",                    "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 38
-  { "Xmp.iptcExt.ArtworkOrObject",               "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 39
-  { "Xmp.iptcExt.AddlModelInfo",                 "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 40
-  { "Xmp.iptcExt.ModelAge",                      "single", -1,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, // 41
-  { "Xmp.iptcExt.MaxAvailWidth",                 "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 42
-  { "Xmp.iptcExt.MaxAvailHeight",                "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 43
-  { "Xmp.iptcExt.DigitalSourceType",             "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 44
-  { "Xmp.plus.MinorModelAgeDisclosure",          "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 45
-  { "Xmp.plus.ModelReleaseStatus",               "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 46
-  { "Xmp.plus.ModelReleaseID",                   "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 47
-  { "Xmp.plus.ImageSupplierName",                "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 48
-  { "Xmp.plus.ImageSupplierID",                  "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 49
-  { "Xmp.plus.ImageSupplierImageID",             "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 50
-  { "Xmp.plus.ImageCreator",                     "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 51
-  { "Xmp.plus.CopyrightOwner",                   "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 52
-  { "Xmp.plus.Licensor",                         "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 53
-  { "Xmp.plus.PropertyReleaseStatus",            "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 54
-  { "Xmp.plus.PropertyReleaseID",                "list",   -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 55
-
-  /* Categories */
-  { "Xmp.photoshop.Category",                    "single",  4,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 56
-  { "Xmp.photoshop.SupplementalCategories",      "multi",  10,  TAG_TYPE_XMP, GIMP_XMP_BAG   }, // 57
-
-  /* GPS */
-  { "Exif.GPSInfo.GPSLongitude",                 "single", -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 58
-  { "Exif.GPSInfo.GPSLongitudeRef",              "combo",  -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 59
-  { "Exif.GPSInfo.GPSLatitude",                  "single", -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 60
-  { "Exif.GPSInfo.GPSLatitudeRef",               "combo",  -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 61
-  { "Exif.GPSInfo.GPSAltitude",                  "single", -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 62
-  { "Exif.GPSInfo.GPSAltitudeRef",               "combo",  -1,  TAG_TYPE_EXIF, GIMP_XMP_NONE }, // 63
-
-  /* DICOM */
-  { "Xmp.DICOM.PatientName",                     "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 64
-  { "Xmp.DICOM.PatientID",                       "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 65
-  { "Xmp.DICOM.PatientDOB",                      "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 66
-  { "Xmp.DICOM.PatientSex",                      "combo",  -1,  TAG_TYPE_XMP, GIMP_XMP_NONE  }, // 67
-  { "Xmp.DICOM.StudyID",                         "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 68
-  { "Xmp.DICOM.StudyPhysician",                  "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 69
-  { "Xmp.DICOM.StudyDateTime",                   "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 70
-  { "Xmp.DICOM.StudyDescription",                "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 71
-  { "Xmp.DICOM.SeriesNumber",                    "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 72
-  { "Xmp.DICOM.SeriesModality",                  "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 73
-  { "Xmp.DICOM.SeriesDateTime",                  "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 74
-  { "Xmp.DICOM.SeriesDescription",               "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 75
-  { "Xmp.DICOM.EquipmentInstitution",            "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 76
-  { "Xmp.DICOM.EquipmentManufacturer",           "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 77
-
-  /* IPTC */
-  { "Xmp.iptc.CiAdrExtadr",                      "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 78
-  { "Xmp.iptc.CiAdrCity",                        "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 79
-  { "Xmp.iptc.CiAdrRegion",                      "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 80
-  { "Xmp.iptc.CiAdrPcode",                       "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 81
-  { "Xmp.iptc.CiAdrCtry",                        "single", -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 82
-  { "Xmp.iptc.CiTelWork",                        "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 83
-  { "Xmp.iptc.CiEmailWork",                      "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }, // 84
-  { "Xmp.iptc.CiUrlWork",                        "multi",  -1,  TAG_TYPE_XMP, GIMP_XMP_TEXT  }  // 85
-
-};
+extern const metadata_tag default_metadata_tags[];
+extern const gint         n_default_metadata_tags;
 
-static const metadata_tag equivalent_metadata_tags[] =
-{
-  { "Iptc.Application2.DateCreated",             "single", 10,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  0
-  { "Iptc.Application2.TransmissionReference",   "single", 12,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  1
-  { "Iptc.Application2.SpecialInstructions",     "single", 13,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  2
-  { "Iptc.Application2.Headline",                "multi",  11,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  3
-  { "Iptc.Application2.Category",                "single", 56,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  4
-  { "Iptc.Application2.City",                    "single", 20,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  5
-  { "Iptc.Application2.ProvinceState",           "single", 21,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  6
-  { "Iptc.Application2.CountryName",             "single", 22,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  7
-  { "Iptc.Application2.Credit",                  "single", 24,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  8
-  { "Iptc.Application2.Source",                  "single", 25,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, //  9
-  { "Iptc.Application2.SuppCategory",            "single", 57,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 10
-  { "Iptc.Application2.Urgency",                 "combo",  26,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 11
-  { "Iptc.Application2.SubLocation",             "single", 28,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 12
-  { "Iptc.Application2.Byline",                  "single",  1,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 13
-  { "Iptc.Application2.Caption",                 "multi",   2,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 14
-  { "Iptc.Application2.Keywords",                "single",  3,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 15
-  { "Iptc.Application2.ObjectName",              "multi",   0,  TAG_TYPE_IPTC, GIMP_XMP_NONE }, // 16
-  { "Iptc.Application2.Copyright",               "single",  4,  TAG_TYPE_IPTC, GIMP_XMP_NONE }  // 17
-};
+extern const metadata_tag equivalent_metadata_tags[];
+extern const gint         n_equivalent_metadata_tags;
 
 /* Digital Source Type Combobox Items
  * http://cv.iptc.org/newscodes/digitalsourcetype/
  */
-static const combobox_str_tag digitalsourcetype[] =
-{
-  { "http://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture";, N_("Original digital capture of a real 
life scene")    },
-  { "http://cv.iptc.org/newscodes/digitalsourcetype/negativeFilm";,   N_("Digitized from a negative on film") 
               },
-  { "http://cv.iptc.org/newscodes/digitalsourcetype/positiveFilm";,   N_("Digitized from a positive on film") 
               },
-  { "http://cv.iptc.org/newscodes/digitalsourcetype/print";,          N_("Digitized from a print on 
non-transparent medium") },
-  { "http://cv.iptc.org/newscodes/digitalsourcetype/softwareImage";,  N_("Created by software")               
               }
-};
+extern const combobox_str_tag digitalsourcetype[];
+extern const gint             n_digitalsourcetype;
 
 /* Model Release Status Combobox Items
  * http://ns.useplus.org/LDF/ldf-XMPSpecification#ModelReleaseStatus
  */
-static const combobox_str_tag modelreleasestatus[] =
-{
-  { "http://ns.useplus.org/ldf/vocab/MR-NON";, N_("None")                                 },
-  { "http://ns.useplus.org/ldf/vocab/MR-NAP";, N_("Not Applicable")                       },
-  { "http://ns.useplus.org/ldf/vocab/MR-NAP";, N_("Unlimited Model Releases")             },
-  { "http://ns.useplus.org/ldf/vocab/MR-LPR";, N_("Limited or Incomplete Model Releases") }
-};
+extern const combobox_str_tag modelreleasestatus[];
+extern const gint             n_modelreleasestatus;
 
 /* Property Release Status Combobox Items
  * http://ns.useplus.org/LDF/ldf-XMPSpecification#PropertyReleaseStatus
  */
-static const combobox_str_tag propertyreleasestatus[] =
-{
-  { "http://ns.useplus.org/ldf/vocab/PR-NON";, N_("None")                                    },
-  { "http://ns.useplus.org/ldf/vocab/PR-NAP";, N_("Not Applicable")                          },
-  { "http://ns.useplus.org/ldf/vocab/PR-NAP";, N_("Unlimited Property Releases")             },
-  { "http://ns.useplus.org/ldf/vocab/PR-LPR";, N_("Limited or Incomplete Property Releases") }
-};
+extern const combobox_str_tag propertyreleasestatus[];
+extern const gint             n_propertyreleasestatus;
 
 /* Minor Model Age Disclosure Combobox Items
  * http://ns.useplus.org/LDF/ldf-XMPSpecification#MinorModelAgeDisclosure
  */
-static const combobox_str_tag minormodelagedisclosure[] =
-{
-  { "http://ns.useplus.org/ldf/vocab/AG-UNK";, N_("Age Unknown")     },
-  { "http://ns.useplus.org/ldf/vocab/AG-A25";, N_("Age 25 or Over")  },
-  { "http://ns.useplus.org/ldf/vocab/AG-A24";, N_("Age 24")          },
-  { "http://ns.useplus.org/ldf/vocab/AG-A23";, N_("Age 23")          },
-  { "http://ns.useplus.org/ldf/vocab/AG-A22";, N_("Age 22")          },
-  { "http://ns.useplus.org/ldf/vocab/AG-A21";, N_("Age 21")          },
-  { "http://ns.useplus.org/ldf/vocab/AG-A20";, N_("Age 20")          },
-  { "http://ns.useplus.org/ldf/vocab/AG-A19";, N_("Age 19")          },
-  { "http://ns.useplus.org/ldf/vocab/AG-A18";, N_("Age 18")          },
-  { "http://ns.useplus.org/ldf/vocab/AG-A17";, N_("Age 17")          },
-  { "http://ns.useplus.org/ldf/vocab/AG-A16";, N_("Age 16")          },
-  { "http://ns.useplus.org/ldf/vocab/AG-A15";, N_("Age 15")          },
-  { "http://ns.useplus.org/ldf/vocab/AG-U14";, N_("Age 14 or Under") }
-};
+extern const combobox_str_tag minormodelagedisclosure[];
+extern const gint             n_minormodelagedisclosure;
 
 /* Urgency */
-static const gchar *urgency[] =
-{
-  N_("None"), N_("High"), N_("2"), N_("3"), N_("4"), N_("Normal"), N_("6"), N_("7"), N_("Low")
-};
+extern const gchar *urgency[];
+extern const gint   n_urgency;
 
 /* Marked */
-static const combobox_int_tag marked[] =
-{
-  { -1,     N_("Unknown")       }, // DO NOT SAVE
-  {  TRUE,  N_("Copyrighted")   }, // TRUE
-  {  FALSE, N_("Public Domain") }, // FALSE
-};
+extern const combobox_int_tag marked[];
+extern const gint             n_marked;
 
 /* Phone Types */
-static const combobox_str_tag phone_types[] =
-{
-  { "",                                      N_("Select a value") },
-  { "http://ns.useplus.org/ldf/vocab/work";,  N_("Work")  },
-  { "http://ns.useplus.org/ldf/vocab/cell";,  N_("Cell")  },
-  { "http://ns.useplus.org/ldf/vocab/fax";,   N_("Fax")   },
-  { "http://ns.useplus.org/ldf/vocab/home";,  N_("Home")  },
-  { "http://ns.useplus.org/ldf/vocab/pager";, N_("Pager") }
-};
+extern const combobox_str_tag phone_types[];
+extern const gint             n_phone_types;
 
 /* DICOM Patient Sex
  * http://dicomlookup.com/lookup.asp?sw=Ttable&q=C.7-1
@@ -327,159 +164,73 @@ static const combobox_str_tag phone_types[] =
  * https://dicomiseasy.blogspot.ca/2011/11/introduction-to-dicom-chapter-iii-dicom.html
  * http://dicom.nema.org/standard.html
  */
-static const combobox_str_tag dicom[] =
-{
-  { "",        N_("Select a value") },
-  { "male",    N_("Male")    },
-  { "female",  N_("Female")  },
-  { "other",   N_("Other")   },
-};
+extern const combobox_str_tag dicom[];
+extern const gint             n_dicom;
 
 /* GPS Altitude Ref */
-static const gchar *gpsaltref[] =
-{
-  N_("Unknown"), N_("Above Sea Level"), N_("Below Sea Level")
-};
+extern const gchar *gpsaltref[];
+extern const gint   n_gpsaltref;
 
 /* GPS Latitude Ref */
-static const gchar *gpslatref[] =
-{
-  N_("Unknown"), N_("North"), N_("South")
-};
+extern const gchar *gpslatref[];
+extern const gint   n_gpslatref;
 
 /* GPS Longitude Ref */
-static const gchar *gpslngref[] =
-{
-  N_("Unknown"), N_("East"), N_("West")
-};
+extern const gchar *gpslngref[];
+extern const gint   n_gpslngref;
 
 /* GPS Measurement System */
-static const gchar *gpsaltsys[] =
-{
-  "M", "FT"
-};
+extern const gchar *gpsaltsys[];
+extern const gint   n_gpsaltsys;
 
-static const TranslateHeaderTag creatorContactInfoHeader =
-{
-  "Xmp.iptc.CreatorContactInfo", "type=\"Struct\"", 8
-};
+extern const TranslateHeaderTag creatorContactInfoHeader;
 
-static const TranslateTag creatorContactInfoTags[] =
-{
-  { "Xmp.iptc.CiAdrExtadr", "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrExtadr", "multi",  -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptc.CiAdrCity",   "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCity",   "single", -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptc.CiAdrRegion", "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrRegion", "single", -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptc.CiAdrPcode",  "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrPcode",  "single", -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptc.CiAdrCtry",   "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiAdrCtry",   "single", -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptc.CiTelWork",   "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiTelWork",   "multi",  -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptc.CiEmailWork", "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiEmailWork", "multi",  -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptc.CiUrlWork",   "Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiUrlWork",   "multi",  -1,  
TAG_TYPE_XMP }
-};
+extern const TranslateTag creatorContactInfoTags[];
 
-static const TranslateHeaderTag locationCreationInfoHeader =
-{
-  "Xmp.iptcExt.LocationCreated", "type=\"Bag\"", 6
-};
+extern const TranslateHeaderTag locationCreationInfoHeader;
 
-static const TranslateTag locationCreationInfoTags[] =
-{
-  { "Xmp.iptcExt.Sublocation",   "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:Sublocation",   "single", -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptcExt.City",          "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:City",          "single", -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptcExt.ProvinceState", "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:ProvinceState", "single", -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptcExt.CountryName",   "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:CountryName",   "single", -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptcExt.CountryCode",   "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:CountryCode",   "single", -1,  
TAG_TYPE_XMP },
-  { "Xmp.iptcExt.WorldRegion",   "Xmp.iptcExt.LocationCreated[1]/Iptc4xmpExt:WorldRegion",   "single", -1,  
TAG_TYPE_XMP }
-};
+extern const TranslateTag locationCreationInfoTags[];
 
-static const TranslateHeaderTag imageSupplierInfoHeader =
-{
-  "Xmp.plus.ImageSupplier", "type=\"Seq\"", 2
-};
+extern const TranslateHeaderTag imageSupplierInfoHeader;
 
-static const TranslateTag imageSupplierInfoTags[] =
-{
-  { "Xmp.plus.ImageSupplierName",   "Xmp.plus.ImageSupplier[1]/plus:ImageSupplierName", "multi",  -1,  
TAG_TYPE_XMP },
-  { "Xmp.plus.ImageSupplierID",     "Xmp.plus.ImageSupplier[1]/plus:ImageSupplierID",   "single", -1,  
TAG_TYPE_XMP }
-};
+extern const TranslateTag imageSupplierInfoTags[];
 
 /* Plus and IPTC extension tags */
 
 #define LICENSOR_HEADER "Xmp.plus.Licensor"
-static const gchar *licensor[] =
-{
-  "/plus:LicensorName",
-  "/plus:LicensorID",
-  "/plus:LicensorTelephone1",
-  "/plus:LicensorTelephoneType1",
-  "/plus:LicensorTelephone2",
-  "/plus:LicensorTelephoneType2",
-  "/plus:LicensorEmail",
-  "/plus:LicensorURL"
-};
+extern const gchar *licensor[];
+extern const gint   n_licensor;
 
 #ifdef USE_TAGS
 #define IMAGESUPPLIER_HEADER "Xmp.plus.ImageSupplier"
-static const gchar *imagesupplier[] =
-{
-  "/plus:ImageSupplierName",
-  "/plus:ImageSupplierID"
-};
+extern const gchar *imagesupplier[];
+extern const gint   n_imagesupplier;
 #endif
 
 #define IMAGECREATOR_HEADER "Xmp.plus.ImageCreator"
-static const gchar *imagecreator[] =
-{
-  "/plus:ImageCreatorName",
-  "/plus:ImageCreatorID"
-};
+extern const gchar *imagecreator[];
+extern const gint   n_imagecreator;
 
 #define COPYRIGHTOWNER_HEADER "Xmp.plus.CopyrightOwner"
-static const gchar *copyrightowner[] =
-{
-  "/plus:CopyrightOwnerName",
-  "/plus:CopyrightOwnerID"
-};
+extern const gchar *copyrightowner[];
+extern const gint   n_copyrightowner;
 
 #define REGISTRYID_HEADER "Xmp.iptcExt.RegistryId"
-static const gchar *registryid[] =
-{
-  "/Iptc4xmpExt:RegOrgId",
-  "/Iptc4xmpExt:RegItemId"
-};
+extern const gchar *registryid[];
+extern const gint   n_registryid;
 
 #define ARTWORKOROBJECT_HEADER "Xmp.iptcExt.ArtworkOrObject"
-static const gchar *artworkorobject[] =
-{
-  "/Iptc4xmpExt:AODateCreated",
-  "/Iptc4xmpExt:AOSource",
-  "/Iptc4xmpExt:AOSourceInvNo",
-  "/Iptc4xmpExt:AOTitle",
-  "/Iptc4xmpExt:AOCopyrightNotice",
-  "/Iptc4xmpExt:AOCreator"
-};
+extern const gchar *artworkorobject[];
+extern const gint   n_artworkorobject;
 
 #define LOCATIONSHOWN_HEADER "Xmp.iptcExt.LocationShown"
-static const gchar *locationshown[] =
-{
-  "/Iptc4xmpExt:Sublocation",
-  "/Iptc4xmpExt:City",
-  "/Iptc4xmpExt:ProvinceState",
-  "/Iptc4xmpExt:CountryName",
-  "/Iptc4xmpExt:CountryCode",
-  "/Iptc4xmpExt:WorldRegion"
-};
+extern const gchar *locationshown[];
+extern const gint   n_locationshown;
 
 #ifdef USE_TAGS
 #define LOCATIONCREATED_HEADER "Xmp.iptcExt.LocationCreated"
-static const gchar *locationcreated[] =
-{
-  "/Iptc4xmpExt:Sublocation",
-  "/Iptc4xmpExt:City",
-  "/Iptc4xmpExt:ProvinceState",
-  "/Iptc4xmpExt:CountryName",
-  "/Iptc4xmpExt:CountryCode",
-  "/Iptc4xmpExt:WorldRegion"
-};
+extern const gchar *locationcreated[];
+extern const gint   n_locationcreated;
 #endif
 
 #endif /* __METADATA_TAGS_H__ */
diff --git a/plug-ins/metadata/metadata-xml.c b/plug-ins/metadata/metadata-xml.c
index 16a5caa7b7..660cc14eda 100644
--- a/plug-ins/metadata/metadata-xml.c
+++ b/plug-ins/metadata/metadata-xml.c
@@ -236,7 +236,7 @@ set_tag_ui (metadata_editor *args,
                                   COL_LICENSOR_EMAIL, list_tag_data[row][7],
                                   COL_LICENSOR_WEB, list_tag_data[row][8],
                                   -1);
-              for (item = 1; item < G_N_ELEMENTS (licensor) + 1; item++)
+              for (item = 1; item < n_licensor + 1; item++)
                 {
                   if (list_tag_data[row][item])
                     {
@@ -273,7 +273,7 @@ set_tag_ui (metadata_editor *args,
                                   COL_IMG_CR8_NAME, list_tag_data[row][1],
                                   COL_IMG_CR8_ID, list_tag_data[row][2],
                                   -1);
-              for (item = 1; item < G_N_ELEMENTS (imagecreator) + 1; item++)
+              for (item = 1; item < n_imagecreator + 1; item++)
                 {
                   if (list_tag_data[row][item])
                     {
@@ -308,7 +308,7 @@ set_tag_ui (metadata_editor *args,
                                   COL_AOO_SRC_INV_ID, list_tag_data[row][5],
                                   COL_AOO_CR_NOT, list_tag_data[row][6],
                                   -1);
-              for (item = 1; item < G_N_ELEMENTS (artworkorobject) + 1; item++)
+              for (item = 1; item < n_artworkorobject + 1; item++)
                 {
                   if (list_tag_data[row][item])
                     {
@@ -343,7 +343,7 @@ set_tag_ui (metadata_editor *args,
                                   COL_REGSITRY_ORG_ID, list_tag_data[row][1],
                                   COL_REGSITRY_ITEM_ID, list_tag_data[row][2],
                                   -1);
-              for (item = 1; item < G_N_ELEMENTS (registryid) + 1; item++)
+              for (item = 1; item < n_registryid + 1; item++)
                 {
                   if (list_tag_data[row][item])
                     {
@@ -376,7 +376,7 @@ set_tag_ui (metadata_editor *args,
                                       COL_CR_OWNER_NAME, list_tag_data[row][1],
                                       COL_CR_OWNER_ID, list_tag_data[row][2],
                                       -1);
-                  for (item = 1; item < G_N_ELEMENTS (copyrightowner) + 1; item++)
+                  for (item = 1; item < n_copyrightowner + 1; item++)
                     {
                       if (list_tag_data[row][item])
                         {
@@ -412,7 +412,7 @@ set_tag_ui (metadata_editor *args,
                                   COL_LOC_SHO_CNTRY_ISO, list_tag_data[row][5],
                                   COL_LOC_SHO_CNTRY_WRLD_REG, list_tag_data[row][6],
                                   -1);
-              for (item = 1; item < G_N_ELEMENTS (locationshown) + 1; item++)
+              for (item = 1; item < n_locationshown + 1; item++)
                 {
                   if (list_tag_data[row][item])
                     {
@@ -892,7 +892,7 @@ xml_parser_end_element (GMarkupParseContext  *context,
       if (str_tag_name && str_tag_value)
         {
           /* make sure to only allow supported tags */
-          for (i = 0; i < G_N_ELEMENTS (equivalent_metadata_tags); i++)
+          for (i = 0; i < n_equivalent_metadata_tags; i++)
             {
               if (strcmp(equivalent_metadata_tags[i].tag, str_tag_name) == 0)
                 {
@@ -918,7 +918,7 @@ xml_parser_end_element (GMarkupParseContext  *context,
           if (str_tag_name && str_tag_value)
             {
               /* make sure to only allow supported tags */
-              for (i = 0; i < G_N_ELEMENTS (default_metadata_tags); i++)
+              for (i = 0; i < n_default_metadata_tags; i++)
                 {
                   if (strcmp(default_metadata_tags[i].tag, str_tag_name) == 0)
                     {
@@ -941,7 +941,7 @@ xml_parser_end_element (GMarkupParseContext  *context,
           if (row_count > 0)
             {
               /* make sure to only allow supported tags */
-              for (i = 0; i < G_N_ELEMENTS (default_metadata_tags); i++)
+              for (i = 0; i < n_default_metadata_tags; i++)
                 {
                   if (strcmp(default_metadata_tags[i].tag, str_tag_name) == 0)
                     {


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