GDateTime accessor
Submitted by Jim Nelson
Link to original bug (#712430)
Description
---- Reported by jim@yorba.org 2013-08-08 13:15:00 -0700 ----
Original Redmine bug id: 7318
Original URL: http://redmine.yorba.org/issues/7318
Searchable id: yorba-bug-7318
Original author: Jim Nelson
Original description:
A number of Exiv2 tags represent date, time-of-day, or date/times. Currently the caller must extract these as a string and convert them manually to a GLib or Posix time structure. Some times there are multiple fields in the metadata that must be combined to form these values.
I think gexiv2 should offer one or more new accessors. In the least, it should offer:
GDateTime* gexiv2_get_date_time(GExiv2Metadata* self, const gchar* tag);
Additionally, we could consider offering:
GDate* gexiv2_get_date(GExiv2Metadata* self, const gchar *tag);
TimeOfDay* gexiv2_get_time_of_day(GExiv2* self, const gchar* tag);
TimeOfDay would need to be created for gexiv2; I can find no such object in GLib. (Perhaps there's a Posix struct I'm not thinking of?)
My suggestion is that this method converts the supplied tag into a GDateTime/GDate/TimeOfDay if possible. If not, it returns NULL. GError might be thrown instead (#7297).
This would provide a basic interface for converting Exiv2 tags into usable objects. Another possibility to consider is to add "composite" accessors which know all the Exiv2 tags it takes to combine into a single data representation of commonly-used metadata (i.e. time created, time digitized, etc.) That should be a different ticket, however.
Related issues: related to gexiv2 - http://redmine.yorba.org/show_bug.cgi?id=7297: Convert Exiv2 exceptions to GError (Open) related to gexiv2 - Feature #7316: Add milliseconds to get_date_time() in GExiv2.py (Open)
--- Bug imported by chaz@yorba.org 2013-11-16 14:44 UTC ---
This bug was previously known as bug 7318 at http://redmine.yorba.org/show_bug.cgi?id=7318
Unknown version " in product gexiv2. Setting version to "!unspecified". Unknown milestone "unknown in product gexiv2. Setting to default milestone for this product, "---". Setting qa contact to the default for this product. This bug either had no qa contact or an invalid one. Resolution set on an open status. Dropping resolution