LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.
GNU General Public License v3.0
201 stars 39 forks source link

Get human-readable EXIF tag description #10

Closed ganego closed 4 years ago

ganego commented 4 years ago

I'm looking for some Python EXIF solution that can handle "MakerNote", so I had to find some exiv2-based solution, one of them is yours.

Is it possible to get the "tag description" via the exiv2 library and your wrapper? Example: https://www.exiv2.org/tags-canon.html. I can get Exif.Canon.ShotInfo but I also want the string Shot information which is from the "tag description" column.

exiv2 seems to support it: https://github.com/Exiv2/exiv2/blob/master/src/canonmn_int.cpp#L427
With probably this:
https://github.com/Exiv2/exiv2/blob/master/include/exiv2/tags.hpp#L207 (tagDesc)

Thank you

LeoHsiao1 commented 4 years ago

Hi! I found that pyexiv2 can't edit the two tags you said:

>>> img.modify_exif({'Exif.Photo.MakerNote': 'test', 'Exif.Canon.ShotInfo': 'test'})  
>>> img.read_exif()['Exif.Photo.MakerNote'] 
''
>>> img.read_exif()['Exif.Canon.ShotInfo']  
''

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'

If you find that API, I can add it to pyexiv2.

github-actions[bot] commented 3 years ago

This issue has been automatically closed because there has been no activity for a month.