plug-ins: Do not write to Iptc.Application2.DateCreated if no date was set.

The metadata-editor allowed Iptc tags to be set if an empty string was
used contrary to Xmp tags. In the case of DateCreated this cause an
invalid date "0-00-00" to be written.

We added a check to only write text Iptc metadata if the value is
not empty.

(cherry picked from commit 0a902456ac)
This commit is contained in:
Jacob Boerema
2021-03-23 15:23:16 -04:00
parent efc41d1fa8
commit 27ee0c87ee

View File

@ -4173,7 +4173,8 @@ metadata_editor_write_callback (GtkWidget *dialog,
{
gexiv2_metadata_clear_tag (GEXIV2_METADATA (g_metadata),
equivalent_metadata_tags[index].tag);
if (! gexiv2_metadata_set_tag_string (GEXIV2_METADATA (g_metadata),
if (*text_value &&
! gexiv2_metadata_set_tag_string (GEXIV2_METADATA (g_metadata),
equivalent_metadata_tags[index].tag,
text_value))
{