GNOME Bugzilla – Bug 712429
Offer composite accessors for commonly-needed information
Last modified: 2018-05-22 12:31:14 UTC
---- Reported by jim@yorba.org 2013-08-08 13:30:00 -0700 ---- Original Redmine bug id: 7319 Original URL: http://redmine.yorba.org/issues/7319 Searchable id: yorba-bug-7319 Original author: Jim Nelson Original description: gexiv2's interface is primarily designed as a GObject wrapper around Exiv2. It does that today reasonably well. The interface also offers conversion functions which can take the metadata and return it not as a string but as an appropriate data type. For example, `gexiv2_metadata_get_tag_long()`. It also offers specialized conversion functions for well-known Exiv2 tags. For example, @gexiv2_metadata_get_fnumber(), which converts the string into a rational then does the math to convert the rational into a double. The further down the above list you go, the further gexiv2 veers from its intended purpose. There is some value in all of the above. It's worth considering adding a final set of functions to this list, something called "composite" metadata in ExifTool. Composite accessors take metadata from a number of locations and puts it together to form a single data object representing some aspect of the photo. A good example would be GDateTime* gexiv2_metadata_get_creation_time(GExiv2Metadata* self); Which could then assemble the best answer for this question from the available metadata and return a single GDateTime as an answer. In EXIF, that would mean including subsecond precision (#7316). For IPTC, that means taking the created date and created time and putting them together. And so on. The difference between these composite accessors and the above are that (a) the user doesn't get to pick the Exiv2 tags used for the determination, (b) they may use multiple tags as sources of information, and (c) the function searches through all domains (EXIF, IPTC, XMP) for available information. It might be worth considering performing this work in Vala, as this layer of abstraction should have no need to touch Exiv2's C++ interface. In essence, these calls use the basic library calls to assemble this information. Related issues: related to gexiv2 - Feature #7644: Offer previews/thumbnails as GdkPixbuf (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_ 7319 at http://redmine.yorba.org/show_bug.cgi?id=7319 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
Here is the documentation on exiftool's Metadata Working Group Composite Tags. http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/MWG.html
Is there scope for a composite hierarchical keywords function? Defacto standard is Adobe's xmp.lr.hierarchicalSubject format, but the following properties also exist out in the wild: Xmp.digiKam.TagsList Xmp.MicrosoftPhoto.LastKeywordXMP Xmp.mwg-kw.Keywords Xmp.acdsee.categories
> Is there scope for a composite hierarchical keywords function? No. I don't believe Exiv2 offers one either. One problem is that those tags use different separators (some slashes, other pipes). So that's something that would need to be accounted for. You might look at how Shotwell solved this problem: https://git.gnome.org/browse/shotwell/tree/src/photos/PhotoMetadata.vala#n864
Yes, I have seen that. It gets more complicated though. ACDSee uses a XML-like format: <Category Assigned="0">6 Level<Category Assigned="1">6.2 Level ... MWG-KW gets really funky (and this is just a simple example): Xmp.mwg-kw.Keywords/mwg-kw:Hierarchy[1]/mwg-kw:Children[1]/mwg-kw:Children[1]/mwg-kw:Children[1]/mwg-kw:Keyword 4thLevel Anyway, the question is, SHOULD gexiv2 offer such a function? There is already one for straight simple tags.
> Anyway, the question is, SHOULD gexiv2 offer such a function? There is > already one for straight simple tags. That's the USD$100,000 question. The key for me is in the title, "commonly-needed information." I don't know that heirarchical tags meet that bar, although the MWG makes a case that they do. Maybe what this ticket should focus on is providing MWG support in gexiv2, as MWG seems to have thought this out more than I have. However, since MWG is closer to a standard, you could also make the argument that this work should be performed in Exiv2 itself and exposed via gexiv2. I lean toward the latter not just because I'm lazy, but because it really does seem like work that all Exiv2 users could take advantage of.
1st, we should make a distinction between core MWG guidelines and hierarchical keywords/tags. Supporting the core MWG guidelines is, for me, a no brainer, under the "commonly-needed information" criteria. http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf Adobe Lightroom hierarchical Subjects are in wide use, not only in Adobe applications but in many other applications. So are the Microsoft Photo and ACDSee hierarchies. They all fall under "commonly-needed information" in my view. The MWG-keywords schema, on the other hand, does not seem to be in active use by any applications. Providing support for converting from and to those properties may be a purely academic exercise. Agreed that all exiv2 users could benefit from these composite tags. But my recent conversations with Robin Mills on the exiv2 forum indicates that converting between various tags is outside of the scope for exiv2. http://dev.exiv2.org/boards/3/topics/1912?r=1923#message-1923
It turns out that exiv2 has some available functions that, in effect, mirror MwG guidelines for mapping keys. http://www.exiv2.org/doc/convert_8hpp.html I have just added support for XMP Dates to that: datetime original, datetime digitized, and datetime modified.
Created attachment 303889 [details] [review] Composite accessors for: Title, Creator, Copyright, Keywords Accessors for Hierarchical Keywords and Location Shown to follow. Those will need a bit more coding skill.
Review of attachment 303889 [details] [review]: ::: gexiv2/gexiv2-metadata.cpp @@ +800,3 @@ +void gexiv2_metadata_clear_title (GExiv2Metadata *self) { + g_return_if_fail(GEXIV2_IS_METADATA (self)); + g_return_if_fail(self->priv->image.get() != NULL); Isn't there some implementation missing?
ok. I'll take another look and try to figure out what is missing. I'm a total amateur at coding, so hopefully it's pretty simple!
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gexiv2/issues/2.