Fix samples/tags.cpp to call ExifTags::taglist() (https://github.com/Exiv2/exiv2/issues/465)

v0.27.3
clanmills 7 years ago committed by Luis Díaz Más
parent 12d44f8f17
commit 4a1d0962fc

@ -49,15 +49,12 @@ int main(int argc, char* argv[])
}
*/
const GroupInfo* groupList = ExifTags::groupList();
int count = 0;
if (groupList) {
while (groupList->tagList_ && count < 10000) {
count++;
while (groupList->tagList_) {
std::cout << groupList->groupName_ << std::endl;
groupList++;
}
}
std::cout << "Groups = " << count << std::endl;
break;
}
@ -89,29 +86,36 @@ int main(int argc, char* argv[])
break;
case 3: {
rc = 1; // assume unhappy ending!
std::string item(argv[1]);
std::string name(argv[2]);
rc = 1; // assume unhappy ending!
if (item == "--group") {
if ( ExifTags::isExifGroup(name) ) {
ExifTags::taglist(std::cout,name);
rc = 0; // result is good
} else {
std::cerr << "warning:"
<< name
<< " is not a valid Exif group name "
<< std::endl
;
const GroupInfo* groupList = ExifTags::groupList();
if (groupList) {
while (groupList->tagList_) {
int count = 0;
while (rc && groupList->tagList_) {
if (name == groupList->groupName_) {
const Exiv2::TagInfo* tagInfo = groupList->tagList_();
while (tagInfo->tag_ != 0xFFFF) {
std::cout << tagInfo->name_ << std::endl;
tagInfo++;
count++;
}
rc = 0; // result is good
std::cout << "Tags = " << count << std::endl;
}
groupList++;
}
}
}
}
} break;
default:

Loading…
Cancel
Save