From 31a2467a61e826e6b08f96c7be5aacfdba466c53 Mon Sep 17 00:00:00 2001 From: postscript-dev Date: Wed, 20 Oct 2021 15:29:13 +0100 Subject: [PATCH] Add exiv2 extract thumb to stdout (#1934): src --- src/actions.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/actions.cpp b/src/actions.cpp index 38a7b937..541fb60f 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -950,6 +950,13 @@ namespace Action { std::cerr << path_ << ": " << _("Image does not contain an Exif thumbnail\n"); } else { + if ( (Params::instance().target_ & Params::ctStdInOut) != 0 ) { + Exiv2::DataBuf buf = exifThumb.copy(); + std::cout.write(reinterpret_cast(buf.data()), + buf.size()); + return 0; + } + std::string thumb = newFilePath(path_, "-thumb"); std::string thumbPath = thumb + thumbExt; if (dontOverwrite(thumbPath)) return 0;