~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to src/exiv2wrapper.cpp

  • Committer: Olivier Tilloy
  • Date: 2010-12-02 18:13:37 UTC
  • mto: This revision was merged to the branch mainline in revision 336.
  • Revision ID: olivier@tilloy.net-20101202181337-oxxxfwry41sqlr11
Fix build against libexiv2 0.21.
This latest release (2010-12-01) changed some public APIs, hence the need for conditional code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
523
523
        _data = 0;
524
524
    }
525
525
 
 
526
// Conditional code, exiv2 0.21 changed APIs we need
 
527
// (see https://bugs.launchpad.net/pyexiv2/+bug/684177).
 
528
#if EXIV2_TEST_VERSION(0,21,0)
 
529
    Exiv2::ExifKey exifKey(key);
 
530
    _type = Exiv2::TypeInfo::typeName(exifKey.defaultTypeId());
 
531
    _name = exifKey.tagName();
 
532
    _label = exifKey.tagLabel();
 
533
    _description = exifKey.tagDesc();
 
534
    _sectionName = Exiv2::ExifTags::sectionName(exifKey);
 
535
    // The section description is not exposed in the API any longer
 
536
    // (see http://dev.exiv2.org/issues/744). For want of anything better,
 
537
    // fall back on the section’s name.
 
538
    _sectionDescription = _sectionName;
 
539
#else
526
540
    const uint16_t tag = _datum->tag();
527
541
    const Exiv2::IfdId ifd = _datum->ifdId();
528
542
    _type = Exiv2::TypeInfo::typeName(Exiv2::ExifTags::tagType(tag, ifd));
531
545
    _description = Exiv2::ExifTags::tagDesc(tag, ifd);
532
546
    _sectionName = Exiv2::ExifTags::sectionName(tag, ifd);
533
547
    _sectionDescription = Exiv2::ExifTags::sectionDesc(tag, ifd);
 
548
#endif
534
549
}
535
550
 
536
551
ExifTag::~ExifTag()