A long time ago, in #10, @LeoHsiao1 expressed interest in adding access to tag description fields to pyexiv2, but had trouble accessing the relevant libexiv2 API.
Comment posted by @LeoHsiao1
Hi!
I found that pyexiv2 can't edit the two tags you said:
I'm calling exiv2's API just like the example, but I don't know how to read tag description.
I tried this Code:
Exiv2::ExifData::const_iterator end = exifData.end();
for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i) {
const char* tn = i->tagdesc();
But there was an error in compilation: 'tagdesc': not a member of 'exiv2:: exifdatum'
@LeoHsiao1: The reason that call didn't work is that the method for accessing the description text is tagDesc(), not tagdesc(), and it actually returns a std::string. So, this should work fine:
Exiv2::ExifData::const_iterator end = exifData.end();
for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i) {
std::string description(i->tagDesc());
A long time ago, in #10, @LeoHsiao1 expressed interest in adding access to tag description fields to
pyexiv2
, but had trouble accessing the relevant libexiv2 API.Comment posted by @LeoHsiao1
Hi! I found that pyexiv2 can't edit the two tags you said:
I'm calling exiv2's API just like the example, but I don't know how to read
tag description
. I tried this Code:But there was an error in compilation:
'tagdesc': not a member of 'exiv2:: exifdatum'
If you find that API, I can add it to pyexiv2.
Originally posted by @LeoHsiao1 in https://github.com/LeoHsiao1/pyexiv2/issues/10#issuecomment-586200536
Update
@LeoHsiao1: The reason that call didn't work is that the method for accessing the description text is
tagDesc()
, nottagdesc()
, and it actually returns astd::string
. So, this should work fine:Or even better, in the world of C++11: