From d86770610ef6df52af1d1cd780af9840f6d559ef Mon Sep 17 00:00:00 2001 From: Edgard Lima Date: Sun, 10 Feb 2008 18:36:46 +0000 Subject: Convert from EXIF to XMP DataTime as local time. Original commit message from CVS: Convert from EXIF to XMP DataTime as local time. --- ext/metadata/TODO | 1 + ext/metadata/metadataexif.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'ext/metadata') diff --git a/ext/metadata/TODO b/ext/metadata/TODO index 085b0822..e028df46 100644 --- a/ext/metadata/TODO +++ b/ext/metadata/TODO @@ -15,6 +15,7 @@ TODO: 5- Improve the test application (to save also in png and to make it possible to set the metadata elements properties) 6- Implement GDateTime support in GLib to be used by GStreamer (http://bugzilla.gnome.org/show_bug.cgi?id=50076) 7- Use a standard GStreamer Data-Time type to map our Data-time tags +8- Make the correct merge mode for multiple value tags (bag and seq) like dc:creator, ... OPEN ISSUES: diff --git a/ext/metadata/metadataexif.c b/ext/metadata/metadataexif.c index 1368ddaf..c5b8f80d 100644 --- a/ext/metadata/metadataexif.c +++ b/ext/metadata/metadataexif.c @@ -613,8 +613,8 @@ metadataparse_exif_content_foreach_entry_func (ExifEntry * entry, if (entry->tag == EXIF_TAG_DATE_TIME_DIGITIZED || entry->tag == EXIF_TAG_DATE_TIME || entry->tag == EXIF_TAG_DATE_TIME_ORIGINAL) { - value = g_string_new_len (str, 21); - /* 21 is enough memory to hold "YYYY-MM-DDTHH:MM:SSZ" */ + value = g_string_new_len (str, 20); + /* 20 is enough memory to hold "YYYY-MM-DDTHH:MM:SS" */ if (metadataparse_exif_convert_to_datetime (value)) { str = value->str; @@ -1092,14 +1092,17 @@ metadataparse_exif_convert_to_datetime (GString * dt) /* "YYYY:MM:DD HH:MM:SS" */ /* 012345678901234567890 */ - if (dt->allocated_len < 21) + if (dt->allocated_len < 20) return FALSE; + /* Fix me: Ideally would be good to get the time zone from othe Exif tag + * for the time being, just use local time as explained in XMP specification + * (converting from EXIF to XMP date and time) */ + dt->str[4] = '-'; dt->str[7] = '-'; dt->str[10] = 'T'; - dt->str[19] = 'Z'; - dt->str[20] = '\0'; + dt->str[19] = '\0'; return TRUE; @@ -1228,8 +1231,8 @@ metadatamux_exif_convert_from_datetime (GString * dt) if (*p == ':') { p++; } else if (*p == 'Z' || *p == '+' || *p == '-') { - /* FIXME: in case of '+' or '-', would it be better to calculate the - * UTC 'Z' date and time? */ + /* FIXME: in case of '+' or '-', it would be better to also fill another + * EXIF tag in order to save, somehow the time zone info */ sprintf (p, ":00"); goto done; } else -- cgit v1.2.1