[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:37:02 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=a8f6bc2
The following commit has been merged in the master branch:
commit a8f6bc2f844aada50e3ad3f9db41b364bf94a293
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sat Mar 12 12:43:04 2005 +0000
Merged revisions 520:521 from branches/Exiv2-0_6_041212, updated test results
---
src/actions.cpp | 16 ++++++++++++----
src/exiv2.cpp | 16 +++++++++++-----
src/exiv2.hpp | 3 ++-
test/data/exiv2-test.out | 9 +++++----
4 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/src/actions.cpp b/src/actions.cpp
index cf8e97b..1a2f0d9 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -878,7 +878,9 @@ namespace Action {
rc = writeThumbnail();
}
if (Params::instance().target_ & ~Params::ctThumb) {
- std::string exvPath = Util::dirname(path_) + SEPERATOR_STR
+ std::string directory = Params::instance().directory_;
+ if (directory.empty()) directory = Util::dirname(path_);
+ std::string exvPath = directory + SEPERATOR_STR
+ Util::basename(path_, true) + ".exv";
if (!Params::instance().force_ && Util::fileExists(exvPath)) {
std::cout << Params::instance().progname()
@@ -923,7 +925,9 @@ namespace Action {
return -3;
}
- std::string thumb = Util::dirname(path_) + SEPERATOR_STR
+ std::string directory = Params::instance().directory_;
+ if (directory.empty()) directory = Util::dirname(path_);
+ std::string thumb = directory + SEPERATOR_STR
+ Util::basename(path_, true) + "-thumb";
std::string thumbExt = exifData.thumbnailExtension();
if (thumbExt.empty()) {
@@ -977,7 +981,9 @@ namespace Action {
&& Params::instance().target_ & Params::ctExif
|| Params::instance().target_ & Params::ctIptc
|| Params::instance().target_ & Params::ctComment) {
- std::string exvPath = Util::dirname(path) + SEPERATOR_STR
+ std::string directory = Params::instance().directory_;
+ if (directory.empty()) directory = Util::dirname(path);
+ std::string exvPath = directory + SEPERATOR_STR
+ Util::basename(path, true) + ".exv";
rc = metacopy(exvPath, path, true);
}
@@ -992,7 +998,9 @@ namespace Action {
int Insert::insertThumbnail(const std::string& path) const
{
- std::string thumbPath = Util::dirname(path) + SEPERATOR_STR
+ std::string directory = Params::instance().directory_;
+ if (directory.empty()) directory = Util::dirname(path);
+ std::string thumbPath = directory + SEPERATOR_STR
+ Util::basename(path, true) + "-thumb.jpg";
if (!Util::fileExists(thumbPath, true)) {
std::cerr << thumbPath
diff --git a/src/exiv2.cpp b/src/exiv2.cpp
index 992b4cf..7a16c59 100644
--- a/src/exiv2.cpp
+++ b/src/exiv2.cpp
@@ -53,7 +53,7 @@ EXIV2_RCSID("@(#) $Id$");
// local declarations
namespace {
- //! List of all command itentifiers and corresponding strings
+ //! List of all command identifiers and corresponding strings
static const CmdIdAndString cmdIdAndString[] = {
add, "add",
set, "set",
@@ -179,8 +179,8 @@ void Params::help(std::ostream& os) const
os << "
Actions:
"
<< " ad | adjust Adjust Exif timestamps by the given time. This
"
<< " action requires the option -a time.
"
- << " pr | print Print Exif or Iptc image metadata.
"
- << " rm | delete Delete the Exif section or thumbnail from the files.
"
+ << " pr | print Print image metadata.
"
+ << " rm | delete Delete image metadata from the files.
"
<< " in | insert Insert metadata from corresponding *.exv files.
"
<< " ex | extract Extract metadata to *.exv and thumbnail image files.
"
<< " mv | rename Rename files according to the Exif create timestamp.
"
@@ -217,8 +217,9 @@ void Params::help(std::ostream& os) const
<< format_ << ".
"
<< " -m file Command file for the modify action. The format for commands is
"
<< " set|add|del <key> [[<type>] <value>].
"
- << " -M cmd One command line for the modify action. The format for the
"
- << " commands is the same as that of the lines of a command file.
";
+ << " -M cmd Command line for the modify action. The format for the
"
+ << " commands is the same as that of the lines of a command file.
"
+ << " -l dir Location (directory) for files to be inserted or extracted.
";
} // Params::help
int Params::option(int opt, const std::string& optarg, int optopt)
@@ -237,6 +238,7 @@ int Params::option(int opt, const std::string& optarg, int optopt)
case 'i': rc = evalInsert(optarg); break;
case 'm': rc = evalModify(opt, optarg); break;
case 'M': rc = evalModify(opt, optarg); break;
+ case 'l': directory_ = optarg; break;
case ':':
std::cerr << progname() << ": Option -" << static_cast<char>(optopt)
<< " requires an argument
";
@@ -558,6 +560,10 @@ int Params::getopt(int argc, char* const argv[])
rc = 1;
}
}
+ if (!directory_.empty() && !(action_ == Action::insert || action_ == Action::extract)) {
+ std::cerr << progname() << ": -l option can only be used with extract or insert actions
";
+ rc = 1;
+ }
return rc;
} // Params::getopt
diff --git a/src/exiv2.hpp b/src/exiv2.hpp
index 982029c..0ae2aab 100644
--- a/src/exiv2.hpp
+++ b/src/exiv2.hpp
@@ -141,6 +141,7 @@ public:
CmdFiles cmdFiles_; //!< Names of the modification command files
CmdLines cmdLines_; //!< Commands from the command line
ModifyCmds modifyCmds_; //!< Parsed modification commands
+ std::string directory_; //!< Location for files to extract/insert
Files files_; //!< List of non-option arguments.
private:
@@ -148,7 +149,7 @@ private:
@brief Default constructor. Note that optstring_ is initialized here.
The c'tor is private to force instantiation through instance().
*/
- Params() : optstring_(":hVvfa:r:p:d:e:i:m:M:"),
+ Params() : optstring_(":hVvfa:r:p:d:e:i:m:M:l:"),
help_(false),
version_(false),
verbose_(false),
diff --git a/test/data/exiv2-test.out b/test/data/exiv2-test.out
index c1daa9a..4a51527 100644
--- a/test/data/exiv2-test.out
+++ b/test/data/exiv2-test.out
@@ -9,15 +9,15 @@ This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Exiv2 help ---------------------------------------------------------------
-Usage: lt-exiv2 [ options ] [ action ] file ...
+Usage: exiv2 [ options ] [ action ] file ...
Manipulate the Exif metadata of images.
Actions:
ad | adjust Adjust Exif timestamps by the given time. This
action requires the option -a time.
- pr | print Print Exif or Iptc image metadata.
- rm | delete Delete the Exif section or thumbnail from the files.
+ pr | print Print image metadata.
+ rm | delete Delete image metadata from the files.
in | insert Insert metadata from corresponding *.exv files.
ex | extract Extract metadata to *.exv and thumbnail image files.
mv | rename Rename files according to the Exif create timestamp.
@@ -54,8 +54,9 @@ Options:
follows strftime(3). Default filename format is %Y%m%d_%H%M%S.
-m file Command file for the modify action. The format for commands is
set|add|del <key> [[<type>] <value>].
- -M cmd One command line for the modify action. The format for the
+ -M cmd Command line for the modify action. The format for the
commands is the same as that of the lines of a command file.
+ -l dir Location (directory) for files to be inserted or extracted.
Adjust -------------------------------------------------------------------
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list