Improved consistency of stderr and stdout output

v0.27.3
Andreas Huggel 21 years ago
parent 22366ada23
commit 90d217f173

@ -20,13 +20,13 @@
*/ */
/* /*
File: actions.cpp File: actions.cpp
Version: $Name: $ $Revision: 1.21 $ Version: $Name: $ $Revision: 1.22 $
Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
History: 08-Dec-03, ahu: created History: 08-Dec-03, ahu: created
*/ */
// ***************************************************************************** // *****************************************************************************
#include "rcsid.hpp" #include "rcsid.hpp"
EXIV2_RCSID("@(#) $Name: $ $Revision: 1.21 $ $RCSfile: actions.cpp,v $") EXIV2_RCSID("@(#) $Name: $ $Revision: 1.22 $ $RCSfile: actions.cpp,v $")
// ***************************************************************************** // *****************************************************************************
// included header files // included header files
@ -556,9 +556,7 @@ namespace Action {
int rc = 0; int rc = 0;
std::string thumbExt = exifData.thumbnailExtension(); std::string thumbExt = exifData.thumbnailExtension();
if (thumbExt.empty()) { if (thumbExt.empty()) {
if (Params::instance().verbose_) { std::cerr << path_ << ": Image does not contain an Exif thumbnail\n";
std::cout << "Image does not contain an Exif thumbnail\n";
}
} }
else { else {
long delta = exifData.eraseThumbnail(); long delta = exifData.eraseThumbnail();
@ -640,22 +638,20 @@ namespace Action {
int Extract::writeThumbnail(const Exiv2::ExifData& exifData) const int Extract::writeThumbnail(const Exiv2::ExifData& exifData) const
{ {
int rc = 0;
std::string thumb = Util::dirname(path_) + "/" std::string thumb = Util::dirname(path_) + "/"
+ Util::basename(path_, true) + "-thumb"; + Util::basename(path_, true) + "-thumb";
std::string thumbExt = exifData.thumbnailExtension(); std::string thumbExt = exifData.thumbnailExtension();
if (Params::instance().verbose_) { if (thumbExt.empty()) {
if (thumbExt.empty()) { std::cerr << path_ << ": Image does not contain an Exif thumbnail\n";
std::cout << "Image does not contain an Exif thumbnail\n"; }
} else {
else { if (Params::instance().verbose_) {
std::cout << "Writing " std::cout << "Writing "
<< exifData.thumbnailFormat() << " thumbnail (" << exifData.thumbnailFormat() << " thumbnail ("
<< exifData.thumbnailSize() << " Bytes) to file " << exifData.thumbnailSize() << " Bytes) to file "
<< thumb << thumbExt << "\n"; << thumb << thumbExt << "\n";
} }
}
int rc = 0;
if (!thumbExt.empty()) {
if (!Params::instance().force_ && Util::fileExists(thumb + thumbExt)) { if (!Params::instance().force_ && Util::fileExists(thumb + thumbExt)) {
std::cout << Params::instance().progname() std::cout << Params::instance().progname()
<< ": Overwrite `" << thumb + thumbExt << "'? "; << ": Overwrite `" << thumb + thumbExt << "'? ";

Loading…
Cancel
Save