[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:47:01 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=52f0bd2
The following commit has been merged in the master branch:
commit 52f0bd2ea177d1e87c4a318e95a620a9867488e4
Author: Robin Mills <robin at clanmills.com>
Date: Thu Sep 22 14:34:01 2016 +0000
#1109 Work in Progress on MinGW/32. Put stdout into binary mode for options -pC -pX, -eABC-, -eABC-
---
include/exiv2/image.hpp | 1 +
src/actions.cpp | 38 ++++++++++++++++++++++++++++++--------
2 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/include/exiv2/image.hpp b/include/exiv2/image.hpp
index 09c8dcb..6eee4ff 100644
--- a/include/exiv2/image.hpp
+++ b/include/exiv2/image.hpp
@@ -105,6 +105,7 @@ namespace Exiv2 {
@throw Error if reading of the file fails or the image data is
not valid (does not look like data of the specific image type).
@caution This function is not thread safe and intended for exiv2 -pS for debugging.
+ @caution You may need to put the stream into binary mode (see src/actions.cpp)
*/
virtual void printStructure(std::ostream& out, PrintStructureOption option =kpsNone, int depth=0);
/*!
diff --git a/src/actions.cpp b/src/actions.cpp
index 873f6b0..0e74e5c 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -234,15 +234,24 @@ namespace Action {
try {
path_ = path;
int rc = 0;
+ Exiv2::PrintStructureOption option = Exiv2::kpsNone ;
switch (Params::instance().printMode_) {
- case Params::pmSummary: rc = printSummary(); break;
- case Params::pmList: rc = printList(); break;
- case Params::pmComment: rc = printComment(); break;
- case Params::pmPreview: rc = printPreviewList(); break;
- case Params::pmStructure: rc = printStructure(std::cout,Exiv2::kpsBasic) ; break;
- case Params::pmXMP: rc = printStructure(std::cout,Exiv2::kpsXMP) ; break;
- case Params::pmIccProfile:rc = printStructure(std::cout,Exiv2::kpsIccProfile); break;
- case Params::pmRecursive: rc = printStructure(std::cout,Exiv2::kpsRecursive) ; break;
+ case Params::pmSummary: rc = printSummary(); break;
+ case Params::pmList: rc = printList(); break;
+ case Params::pmComment: rc = printComment(); break;
+ case Params::pmPreview: rc = printPreviewList(); break;
+ case Params::pmStructure: rc = printStructure(std::cout,Exiv2::kpsBasic) ; break;
+ case Params::pmRecursive: rc = printStructure(std::cout,Exiv2::kpsRecursive) ; break;
+
+ case Params::pmXMP:
+ option = option == Exiv2::kpsNone ? Exiv2::kpsXMP : option; // drop
+ case Params::pmIccProfile:{
+ option = option == Exiv2::kpsNone ? Exiv2::kpsIccProfile : option;
+#ifdef __MINGW__
+ _setmode(_fileno(stdout),O_BINARY);
+#endif
+ rc = printStructure(std::cout,option);
+ } break;
}
return rc;
}
@@ -1060,6 +1069,12 @@ namespace Action {
path_ = path;
int rc = 0;
+#ifdef __MINGW__
+ if ( Params::instance().target_ & Params::ctStdInOut ) {
+ _setmode(_fileno(stdout),O_BINARY);
+ }
+#endif
+
if (!rc && Params::instance().target_ & Params::ctThumb) {
rc = writeThumbnail();
}
@@ -1249,6 +1264,13 @@ namespace Action {
<< ": " << _("Failed to open the file
");
return -1;
}
+
+#ifdef __MINGW__
+ if ( Params::instance().target_ & Params::ctStdInOut ) {
+ _setmode(_fileno(stdin),O_BINARY);
+ }
+#endif
+
int rc = 0;
Timestamp ts;
if (Params::instance().preserve_) {
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list