|
|
@ -232,36 +232,43 @@ namespace Action {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int Print::run(const std::string& path)
|
|
|
|
int Print::run(const std::string& path)
|
|
|
|
try {
|
|
|
|
{
|
|
|
|
path_ = path;
|
|
|
|
try {
|
|
|
|
int rc = 0;
|
|
|
|
path_ = path;
|
|
|
|
Exiv2::PrintStructureOption option = Exiv2::kpsNone ;
|
|
|
|
int rc = 0;
|
|
|
|
switch (Params::instance().printMode_) {
|
|
|
|
Exiv2::PrintStructureOption option = Exiv2::kpsNone ;
|
|
|
|
case Params::pmSummary: rc = printSummary(); break;
|
|
|
|
switch (Params::instance().printMode_) {
|
|
|
|
case Params::pmList: rc = printList(); break;
|
|
|
|
case Params::pmSummary: rc = printSummary(); break;
|
|
|
|
case Params::pmComment: rc = printComment(); break;
|
|
|
|
case Params::pmList: rc = printList(); break;
|
|
|
|
case Params::pmPreview: rc = printPreviewList(); break;
|
|
|
|
case Params::pmComment: rc = printComment(); break;
|
|
|
|
case Params::pmStructure: rc = printStructure(std::cout,Exiv2::kpsBasic) ; break;
|
|
|
|
case Params::pmPreview: rc = printPreviewList(); break;
|
|
|
|
case Params::pmRecursive: rc = printStructure(std::cout,Exiv2::kpsRecursive) ; break;
|
|
|
|
case Params::pmStructure: rc = printStructure(std::cout,Exiv2::kpsBasic) ; break;
|
|
|
|
|
|
|
|
case Params::pmRecursive: rc = printStructure(std::cout,Exiv2::kpsRecursive) ; break;
|
|
|
|
case Params::pmXMP:
|
|
|
|
|
|
|
|
if (option == Exiv2::kpsNone)
|
|
|
|
case Params::pmXMP:
|
|
|
|
option = Exiv2::kpsXMP;
|
|
|
|
if (option == Exiv2::kpsNone)
|
|
|
|
// drop
|
|
|
|
option = Exiv2::kpsXMP;
|
|
|
|
case Params::pmIccProfile:
|
|
|
|
// drop
|
|
|
|
if (option == Exiv2::kpsNone)
|
|
|
|
case Params::pmIccProfile:
|
|
|
|
option = Exiv2::kpsIccProfile;
|
|
|
|
if (option == Exiv2::kpsNone)
|
|
|
|
_setmode(_fileno(stdout),O_BINARY);
|
|
|
|
option = Exiv2::kpsIccProfile;
|
|
|
|
rc = printStructure(std::cout,option);
|
|
|
|
_setmode(_fileno(stdout),O_BINARY);
|
|
|
|
break;
|
|
|
|
rc = printStructure(std::cout,option);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch(const Exiv2::AnyError& e) {
|
|
|
|
|
|
|
|
std::cerr << "Exiv2 exception in print action for file "
|
|
|
|
|
|
|
|
<< path << ":\n" << e << "\n";
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch(const std::overflow_error& e) {
|
|
|
|
|
|
|
|
std::cerr << "std::overflow_error exception in print action for file "
|
|
|
|
|
|
|
|
<< path << ":\n" << e.what() << "\n";
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return rc;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch(const Exiv2::AnyError& e) {
|
|
|
|
|
|
|
|
std::cerr << "Exiv2 exception in print action for file "
|
|
|
|
|
|
|
|
<< path << ":\n" << e << "\n";
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
} // Print::run
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Print::printStructure(std::ostream& out, Exiv2::PrintStructureOption option)
|
|
|
|
int Print::printStructure(std::ostream& out, Exiv2::PrintStructureOption option)
|
|
|
|
{
|
|
|
|
{
|
|
|
|