|
|
@ -2319,12 +2319,8 @@ const TagInfo* mnTagList() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isMakerIfd(IfdId ifdId) {
|
|
|
|
bool isMakerIfd(IfdId ifdId) {
|
|
|
|
bool rc = false;
|
|
|
|
|
|
|
|
auto ii = Exiv2::find(groupInfo, ifdId);
|
|
|
|
auto ii = Exiv2::find(groupInfo, ifdId);
|
|
|
|
if (ii && 0 == strcmp(ii->ifdName_, "Makernote")) {
|
|
|
|
return ii && strcmp(ii->ifdName_, "Makernote") == 0;
|
|
|
|
rc = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isExifIfd(IfdId ifdId) {
|
|
|
|
bool isExifIfd(IfdId ifdId) {
|
|
|
@ -2355,8 +2351,7 @@ bool isExifIfd(IfdId ifdId) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void taglist(std::ostream& os, IfdId ifdId) {
|
|
|
|
void taglist(std::ostream& os, IfdId ifdId) {
|
|
|
|
const TagInfo* ti = Internal::tagList(ifdId);
|
|
|
|
if (auto ti = tagList(ifdId)) {
|
|
|
|
if (ti) {
|
|
|
|
|
|
|
|
for (int k = 0; ti[k].tag_ != 0xffff; ++k) {
|
|
|
|
for (int k = 0; ti[k].tag_ != 0xffff; ++k) {
|
|
|
|
os << ti[k] << "\n";
|
|
|
|
os << ti[k] << "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2364,59 +2359,54 @@ void taglist(std::ostream& os, IfdId ifdId) {
|
|
|
|
} // taglist
|
|
|
|
} // taglist
|
|
|
|
|
|
|
|
|
|
|
|
const TagInfo* tagList(IfdId ifdId) {
|
|
|
|
const TagInfo* tagList(IfdId ifdId) {
|
|
|
|
auto ii = Exiv2::find(groupInfo, ifdId);
|
|
|
|
if (auto ii = Exiv2::find(groupInfo, ifdId))
|
|
|
|
if (!ii || !ii->tagList_)
|
|
|
|
if (ii->tagList_)
|
|
|
|
return nullptr;
|
|
|
|
return ii->tagList_();
|
|
|
|
return ii->tagList_();
|
|
|
|
return nullptr;
|
|
|
|
} // tagList
|
|
|
|
} // tagList
|
|
|
|
|
|
|
|
|
|
|
|
const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
|
|
|
|
const TagInfo* tagInfo(uint16_t tag, IfdId ifdId) {
|
|
|
|
const TagInfo* ti = tagList(ifdId);
|
|
|
|
if (auto ti = tagList(ifdId)) {
|
|
|
|
if (!ti)
|
|
|
|
int idx = 0;
|
|
|
|
return nullptr;
|
|
|
|
for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
|
|
|
|
int idx = 0;
|
|
|
|
if (ti[idx].tag_ == tag)
|
|
|
|
for (idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
|
|
|
|
break;
|
|
|
|
if (ti[idx].tag_ == tag)
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
return &ti[idx];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return &ti[idx];
|
|
|
|
return nullptr;
|
|
|
|
} // tagInfo
|
|
|
|
} // tagInfo
|
|
|
|
|
|
|
|
|
|
|
|
const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
|
|
|
|
const TagInfo* tagInfo(const std::string& tagName, IfdId ifdId) {
|
|
|
|
const TagInfo* ti = tagList(ifdId);
|
|
|
|
|
|
|
|
if (!ti)
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
if (tagName.empty())
|
|
|
|
if (tagName.empty())
|
|
|
|
return nullptr;
|
|
|
|
return nullptr;
|
|
|
|
const char* tn = tagName.c_str();
|
|
|
|
if (auto ti = tagList(ifdId)) {
|
|
|
|
for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
|
|
|
|
const char* tn = tagName.c_str();
|
|
|
|
if (0 == strcmp(ti[idx].name_, tn)) {
|
|
|
|
for (int idx = 0; ti[idx].tag_ != 0xffff; ++idx) {
|
|
|
|
return &ti[idx];
|
|
|
|
if (0 == strcmp(ti[idx].name_, tn)) {
|
|
|
|
|
|
|
|
return &ti[idx];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
return nullptr;
|
|
|
|
} // tagInfo
|
|
|
|
} // tagInfo
|
|
|
|
|
|
|
|
|
|
|
|
IfdId groupId(const std::string& groupName) {
|
|
|
|
IfdId groupId(const std::string& groupName) {
|
|
|
|
IfdId ifdId = IfdId::ifdIdNotSet;
|
|
|
|
if (auto ii = Exiv2::find(groupInfo, groupName))
|
|
|
|
auto ii = Exiv2::find(groupInfo, groupName);
|
|
|
|
return static_cast<IfdId>(ii->ifdId_);
|
|
|
|
if (ii)
|
|
|
|
return IfdId::ifdIdNotSet;
|
|
|
|
ifdId = static_cast<IfdId>(ii->ifdId_);
|
|
|
|
|
|
|
|
return ifdId;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const char* ifdName(IfdId ifdId) {
|
|
|
|
const char* ifdName(IfdId ifdId) {
|
|
|
|
auto ii = Exiv2::find(groupInfo, ifdId);
|
|
|
|
if (auto ii = Exiv2::find(groupInfo, ifdId))
|
|
|
|
if (!ii)
|
|
|
|
return ii->ifdName_;
|
|
|
|
return groupInfo[0].ifdName_;
|
|
|
|
return groupInfo[0].ifdName_;
|
|
|
|
return ii->ifdName_;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const char* groupName(IfdId ifdId) {
|
|
|
|
const char* groupName(IfdId ifdId) {
|
|
|
|
auto ii = Exiv2::find(groupInfo, ifdId);
|
|
|
|
if (auto ii = Exiv2::find(groupInfo, ifdId))
|
|
|
|
if (!ii)
|
|
|
|
return ii->groupName_;
|
|
|
|
return groupInfo[0].groupName_;
|
|
|
|
return groupInfo[0].groupName_;
|
|
|
|
return ii->groupName_;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::ostream& printValue(std::ostream& os, const Value& value, const ExifData*) {
|
|
|
|
std::ostream& printValue(std::ostream& os, const Value& value, const ExifData*) {
|
|
|
@ -2947,13 +2937,15 @@ std::ostream& print0xa001(std::ostream& os, const Value& value, const ExifData*
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//! SensingMethod, tag 0xa217
|
|
|
|
//! SensingMethod, tag 0xa217
|
|
|
|
constexpr TagDetails exifSensingMethod[] = {{1, N_("Not defined")},
|
|
|
|
constexpr TagDetails exifSensingMethod[] = {
|
|
|
|
{2, N_("One-chip color area")},
|
|
|
|
{1, N_("Not defined")},
|
|
|
|
{3, N_("Two-chip color area")},
|
|
|
|
{2, N_("One-chip color area")},
|
|
|
|
{4, N_("Three-chip color area")},
|
|
|
|
{3, N_("Two-chip color area")},
|
|
|
|
{5, N_("Color sequential area")},
|
|
|
|
{4, N_("Three-chip color area")},
|
|
|
|
{7, N_("Trilinear sensor")},
|
|
|
|
{5, N_("Color sequential area")},
|
|
|
|
{8, N_("Color sequential linear")}};
|
|
|
|
{7, N_("Trilinear sensor")},
|
|
|
|
|
|
|
|
{8, N_("Color sequential linear")},
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
std::ostream& print0xa217(std::ostream& os, const Value& value, const ExifData* metadata) {
|
|
|
|
std::ostream& print0xa217(std::ostream& os, const Value& value, const ExifData* metadata) {
|
|
|
|
return EXV_PRINT_TAG(exifSensingMethod)(os, value, metadata);
|
|
|
|
return EXV_PRINT_TAG(exifSensingMethod)(os, value, metadata);
|
|
|
@ -2963,7 +2955,8 @@ std::ostream& print0xa217(std::ostream& os, const Value& value, const ExifData*
|
|
|
|
constexpr TagDetails exifFileSource[] = {
|
|
|
|
constexpr TagDetails exifFileSource[] = {
|
|
|
|
{1, N_("Film scanner")}, // Not defined to Exif 2.2 spec.
|
|
|
|
{1, N_("Film scanner")}, // Not defined to Exif 2.2 spec.
|
|
|
|
{2, N_("Reflexion print scanner")}, // but used by some scanner device softwares.
|
|
|
|
{2, N_("Reflexion print scanner")}, // but used by some scanner device softwares.
|
|
|
|
{3, N_("Digital still camera")}};
|
|
|
|
{3, N_("Digital still camera")},
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
std::ostream& print0xa300(std::ostream& os, const Value& value, const ExifData* metadata) {
|
|
|
|
std::ostream& print0xa300(std::ostream& os, const Value& value, const ExifData* metadata) {
|
|
|
|
return EXV_PRINT_TAG(exifFileSource)(os, value, metadata);
|
|
|
|
return EXV_PRINT_TAG(exifFileSource)(os, value, metadata);
|
|
|
|