Feature #1337

include mpfTagInfo in ExifTags::taglist

Added by Norbert Wagner 3 months ago. Updated 3 months ago.

Status:AssignedStart date:18 Feb 2018
Priority:NormalDue date:
Assignee:Robin Mills% Done:

10%

Category:metadataEstimated time:4.00 hours
Target version:0.27

Description

Hello,

I recognized that ExifTags::taglist (in tags.cpp) lists ifdTagInfo, exifTagInfo, iopTagInfo and gpsTagInfo, but mpfTagInfo is missing. I think adding it would be more consistent - or was there a reason not to include it?

Kind regards

Norbert

History

#1 Updated by Robin Mills 3 months ago

  • Category set to metadata
  • Status changed from New to Assigned
  • Assignee set to Robin Mills
  • Priority changed from Low to Normal
  • Target version set to 0.27

Hello again Norbert

I thought something was added in v0.26 to deal with this. http://dev.exiv2.org/issues/1275

Off hand, I don't remember anything about this. If you know something should else be added, I'll be happy to accept a patch.

1052 rmills@rmillsmbp:~/gnu/exiv2/trunk $ svn blame src/tags.cpp  | grep mpf
  4705 robinwmill         { mpfId,           "MPF",       "MpfInfo",      mpfTagList                     },
  4704 robinwmill         { mpfTags,         "MPF",                  N_("CIPA Multi-Picture Format")    },
  4165 robinwmill     static const TagInfo mpfTagInfo[] = {
  4704 robinwmill                 mpfId, mpfTags, asciiString, 0, printValue),
  4704 robinwmill                 mpfId, mpfTags, undefined, -1, printExifVersion),
  4704 robinwmill                 mpfId, mpfTags, asciiString, 0, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, unsignedLong, 1, printValue),
  4704 robinwmill                 mpfId, mpfTags, asciiString, -1, printValue)
  4165 robinwmill     const TagInfo* mpfTagList()
  4165 robinwmill         return mpfTagInfo;
  4705 robinwmill         case mpfId:
1053 rmills@rmillsmbp:~/gnu/exiv2/trunk $ svn log --revision 4704
------------------------------------------------------------------------
r4704 | robinwmills | 2017-02-08 20:10:01 +0000 (Wed, 08 Feb 2017) | 1 line

#1275 Fix submitted.
------------------------------------------------------------------------
1054 rmills@rmillsmbp:~/gnu/exiv2/trunk $

#2 Updated by Robin Mills 3 months ago

Norbert:

I think you're discussing this code in tags.cpp which I'm extracting with $ svn blame src/tags.cpp :

  2322    ahuggel     void ExifTags::taglist(std::ostream& os)
  2322    ahuggel     {
  2322    ahuggel         for (int i=0; ifdTagInfo[i].tag_ != 0xffff; ++i) {
  2322    ahuggel             os << ifdTagInfo[i] << "\n";
  2322    ahuggel         }
  2322    ahuggel         for (int i=0; exifTagInfo[i].tag_ != 0xffff; ++i) {
  2322    ahuggel             os << exifTagInfo[i] << "\n";
  2322    ahuggel         }
  2322    ahuggel         for (int i=0; iopTagInfo[i].tag_ != 0xffff; ++i) {
  2322    ahuggel             os << iopTagInfo[i] << "\n";
  2322    ahuggel         }
  2322    ahuggel         for (int i=0; gpsTagInfo[i].tag_ != 0xffff; ++i) {
  2322    ahuggel             os << gpsTagInfo[i] << "\n";
  2322    ahuggel         }
  2322    ahuggel     } // ExifTags::taglist
  2322    ahuggel 
  2336    ahuggel     void ExifTags::taglist(std::ostream& os, const std::string& groupName)
  2322    ahuggel     {
  2336    ahuggel         IfdId ifdId = Internal::groupId(groupName);
  2331    ahuggel         Internal::taglist(os, ifdId);
  2331    ahuggel     }

That code predates adding mpfTagInfo in v0.26 and could easily be updated to respect mpfTagInfo. I believe that code is only used by samples/taglist.cpp (which isn't used by the test suite). It is in the API: http://www.exiv2.org/doc/classExiv2_1_1ExifTags.html

Changing this seems rather unimportant to me - however you're welcome to give me a reason why this should be changed.

#3 Updated by Norbert Wagner 3 months ago

Hello Robin,

I am using taglist to have a list of all tags supported by exiv2 with their description. In the GUI the user then can get a description of the tag when mouse pointer is above the field showing a tag. This feature is not very essential, that's way I set priority to low. And it is also no challenge for me to write my own taglist to cover mpfTagInfo as well.

Kind regards

Norbert

#4 Updated by Robin Mills 3 months ago

  • % Done changed from 0 to 10
  • Estimated time set to 4.00

Norbert

I think you've put forward a good reason to change this for v0.27.

I have a reason to be reluctant to add stuff to Exiv2 at the moment. When v0.26 was release in April 2017, we switched to storing the code on http://github.com/Exiv2/exiv2 I don't understand git. I think it's also a good idea to add a test for samples/taglist.cpp to the test suite which is being refactored in python at the moment.

So, I'm going to leave this open and hope to submit a PR (for both ExifTags::taglist and the test suite) later in the v0.27 project (when my git skills are sufficient). I could open an issue on GitHub to reference this discussion, however I'd prefer to keep down the number of open issues on GitHub. This matter will receive attention later in the v0.27 project.

Robin

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux