[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:40:12 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=f90d554
The following commit has been merged in the master branch:
commit f90d554489617ee71b65b0cb26828532a0dc6ac8
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Mon Dec 8 05:32:02 2008 +0000
* Consolidated exiv2 tool print code
* Added option to print all metadata (-pa)
* Added control for type of metadata printed with -P
* API change, class Metadatum and derived classes: Added familyName() and groupName() to the Metadatum API
---
src/actions.cpp | 329 +++++++++++++++++++++-------------------------
src/actions.hpp | 11 +-
src/exif.hpp | 2 +
src/exiv2.1 | 27 ++--
src/exiv2.cpp | 38 +++---
src/exiv2.hpp | 13 +-
src/iptc.hpp | 6 +-
src/metadatum.hpp | 8 +-
src/xmp.cpp | 5 +
src/xmp.hpp | 1 +
test/conversions.sh | 46 +++----
test/data/conversions.out | 10 ++
test/data/exiv2-test.out | 16 ++-
13 files changed, 266 insertions(+), 246 deletions(-)
diff --git a/src/actions.cpp b/src/actions.cpp
index 6f2a105..f5abaea 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -224,12 +224,10 @@ namespace Action {
path_ = path;
int rc = 0;
switch (Params::instance().printMode_) {
- case Params::pmSummary: rc = printSummary(); break;
- case Params::pmList: rc = printList(); break;
- case Params::pmIptc: rc = printIptc(); break;
- case Params::pmXmp: rc = printXmp(); break;
- case Params::pmComment: rc = printComment(); break;
- case Params::pmPreview: rc = printPreviewList(); 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;
}
return rc;
}
@@ -628,207 +626,174 @@ namespace Action {
int Print::printList()
{
+ int rc = 0;
if (!Exiv2::fileExists(path_, true)) {
std::cerr << path_
<< ": " << _("Failed to open the file
");
- return -1;
+ rc = -1;
}
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path_);
assert(image.get() != 0);
image->readMetadata();
- Exiv2::ExifData& exifData = image->exifData();
- if (exifData.empty()) {
- std::cerr << path_
- << ": " << _("No Exif data found in the file
");
- return -3;
- }
- Exiv2::ExifData::const_iterator md;
bool const manyFiles = Params::instance().files_.size() > 1;
- for (md = exifData.begin(); md != exifData.end(); ++md) {
- if ( Params::instance().unknown_
- && md->tagName().substr(0, 2) == "0x") {
- continue;
- }
- if (manyFiles) {
- std::cout << std::setfill(' ') << std::left << std::setw(20)
- << path_ << " ";
- }
- bool first = true;
- if (Params::instance().printItems_ & Params::prTag) {
- if (!first) std::cout << " ";
- first = false;
- std::cout << "0x" << std::setw(4) << std::setfill('0')
- << std::right << std::hex
- << md->tag();
- }
- if (Params::instance().printItems_ & Params::prGroup) {
- if (!first) std::cout << " ";
- first = false;
- std::cout << std::setw(12) << std::setfill(' ') << std::left
- << md->groupName();
- }
- if (Params::instance().printItems_ & Params::prKey) {
- if (!first) std::cout << " ";
- first = false;
- std::cout << std::setfill(' ') << std::left << std::setw(44)
- << md->key();
- }
- if (Params::instance().printItems_ & Params::prName) {
- if (!first) std::cout << " ";
- first = false;
- std::cout << std::setw(27) << std::setfill(' ') << std::left
- << md->tagName();
+ // Set defaults for metadata types and data columns
+ if (Params::instance().printTags_ == Exiv2::mdNone) {
+ Params::instance().printTags_ = Exiv2::mdExif | Exiv2::mdIptc | Exiv2::mdXmp;
+ }
+ if (Params::instance().printItems_ == 0) {
+ Params::instance().printItems_ = Params::prKey | Params::prType | Params::prCount | Params::prTrans;
+ }
+ if (Params::instance().printTags_ & Exiv2::mdExif) {
+ Exiv2::ExifData& exifData = image->exifData();
+ for (Exiv2::ExifData::const_iterator md = exifData.begin();
+ md != exifData.end(); ++md) {
+ printMetadatum(*md, image.get(), manyFiles);
}
- if (Params::instance().printItems_ & Params::prLabel) {
- if (!first) std::cout << " ";
- first = false;
- std::cout << std::setw(30) << std::setfill(' ') << std::left
- << md->tagLabel();
- }
- if (Params::instance().printItems_ & Params::prType) {
- if (!first) std::cout << " ";
- first = false;
- std::cout << std::setw(9) << std::setfill(' ') << std::left;
- const char* tn = md->typeName();
- if (tn) {
- std::cout << tn;
- }
- else {
- std::ostringstream os;
- os << "0x" << std::setw(4) << std::setfill('0') << std::hex << md->typeId();
- std::cout << os.str();
+ if (exifData.empty()) {
+ if (Params::instance().verbose_) {
+ std::cerr << path_ << ": " << _("No Exif data found in the file
");
}
+ rc = -3;
}
- if (Params::instance().printItems_ & Params::prCount) {
- if (!first) std::cout << " ";
- first = false;
- std::cout << std::dec << std::setw(3)
- << std::setfill(' ') << std::right
- << md->count();
- }
- if (Params::instance().printItems_ & Params::prSize) {
- if (!first) std::cout << " ";
- first = false;
- std::cout << std::dec << std::setw(3)
- << std::setfill(' ') << std::right
- << md->size();
+ }
+ if (Params::instance().printTags_ & Exiv2::mdIptc) {
+ Exiv2::IptcData& iptcData = image->iptcData();
+ for (Exiv2::IptcData::const_iterator md = iptcData.begin();
+ md != iptcData.end(); ++md) {
+ printMetadatum(*md, image.get(), manyFiles);
}
- if (Params::instance().printItems_ & Params::prValue) {
- if (!first) std::cout << " ";
- first = false;
- if ( Params::instance().binary_
- && md->typeId() == Exiv2::undefined
- && md->size() > 100) {
- std::cout << _("(Binary value suppressed)") << std::endl;
- continue;
+ if (iptcData.empty()) {
+ if (Params::instance().verbose_) {
+ std::cerr << path_ << ": " << _("No IPTC data found in the file
");
}
- std::cout << std::dec << md->value();
+ rc = -3;
}
- if (Params::instance().printItems_ & Params::prTrans) {
- if (!first) std::cout << " ";
- first = false;
- if ( Params::instance().binary_
- && md->typeId() == Exiv2::undefined
- && md->size() > 100) {
- std::cout << _("(Binary value suppressed)") << std::endl;
- continue;
- }
- std::cout << std::dec << md->print(&exifData);
+ }
+ if (Params::instance().printTags_ & Exiv2::mdXmp) {
+ Exiv2::XmpData& xmpData = image->xmpData();
+ for (Exiv2::XmpData::const_iterator md = xmpData.begin();
+ md != xmpData.end(); ++md) {
+ printMetadatum(*md, image.get(), manyFiles);
}
- if (Params::instance().printItems_ & Params::prHex) {
- if (!first) std::cout << std::endl;
- first = false;
- if ( Params::instance().binary_
- && md->typeId() == Exiv2::undefined
- && md->size() > 100) {
- std::cout << _("(Binary value suppressed)") << std::endl;
- continue;
+ if (xmpData.empty()) {
+ if (Params::instance().verbose_) {
+ std::cerr << path_ << ": " << _("No XMP data found in the file
");
}
- Exiv2::DataBuf buf(md->size());
- md->copy(buf.pData_, image->byteOrder());
- Exiv2::hexdump(std::cout, buf.pData_, buf.size_);
+ rc = -3;
}
- std::cout << std::endl;
}
-
- return 0;
+ return rc;
} // Print::printList
- int Print::printIptc()
- {
- if (!Exiv2::fileExists(path_, true)) {
- std::cerr << path_
- << ": " << _("Failed to open the file
");
- return -1;
- }
- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path_);
- assert(image.get() != 0);
- image->readMetadata();
- Exiv2::IptcData& iptcData = image->iptcData();
- if (iptcData.empty()) {
- std::cerr << path_
- << ": " << _("No IPTC data found in the file
");
- return -3;
- }
- Exiv2::IptcData::const_iterator end = iptcData.end();
- Exiv2::IptcData::const_iterator md;
- bool const manyFiles = Params::instance().files_.size() > 1;
- for (md = iptcData.begin(); md != end; ++md) {
- std::cout << std::setfill(' ') << std::left;
- if (manyFiles) {
- std::cout << std::setw(20) << path_ << " ";
+ void Print::printMetadatum(const Exiv2::Metadatum& md,
+ const Exiv2::Image* pImage,
+ bool const manyFiles)
+ {
+ if ( Params::instance().unknown_
+ && md.tagName().substr(0, 2) == "0x") {
+ return;
+ }
+ if (manyFiles) {
+ std::cout << std::setfill(' ') << std::left << std::setw(20)
+ << path_ << " ";
+ }
+ bool first = true;
+ if (Params::instance().printItems_ & Params::prTag) {
+ if (!first) std::cout << " ";
+ first = false;
+ std::cout << "0x" << std::setw(4) << std::setfill('0')
+ << std::right << std::hex
+ << md.tag();
+ }
+ if (Params::instance().printItems_ & Params::prGroup) {
+ if (!first) std::cout << " ";
+ first = false;
+ std::cout << std::setw(12) << std::setfill(' ') << std::left
+ << md.groupName();
+ }
+ if (Params::instance().printItems_ & Params::prKey) {
+ if (!first) std::cout << " ";
+ first = false;
+ std::cout << std::setfill(' ') << std::left << std::setw(44)
+ << md.key();
+ }
+ if (Params::instance().printItems_ & Params::prName) {
+ if (!first) std::cout << " ";
+ first = false;
+ std::cout << std::setw(27) << std::setfill(' ') << std::left
+ << md.tagName();
+ }
+ if (Params::instance().printItems_ & Params::prLabel) {
+ if (!first) std::cout << " ";
+ first = false;
+ std::cout << std::setw(30) << std::setfill(' ') << std::left
+ << md.tagLabel();
+ }
+ if (Params::instance().printItems_ & Params::prType) {
+ if (!first) std::cout << " ";
+ first = false;
+ std::cout << std::setw(9) << std::setfill(' ') << std::left;
+ const char* tn = md.typeName();
+ if (tn) {
+ std::cout << tn;
+ }
+ else {
+ std::ostringstream os;
+ os << "0x" << std::setw(4) << std::setfill('0') << std::hex << md.typeId();
+ std::cout << os.str();
}
- std::cout << std::setw(44)
- << md->key() << " "
- << std::setw(9) << std::setfill(' ') << std::left
- << md->typeName() << " "
- << std::dec << std::setw(3)
- << std::setfill(' ') << std::right
- << md->count() << " "
- << std::dec << md->value()
- << std::endl;
- }
-
- return 0;
- } // Print::printIptc
-
- int Print::printXmp()
- {
- if (!Exiv2::fileExists(path_, true)) {
- std::cerr << path_
- << ": " << _("Failed to open the file
");
- return -1;
}
- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path_);
- assert(image.get() != 0);
- image->readMetadata();
- Exiv2::XmpData& xmpData = image->xmpData();
- if (xmpData.empty()) {
- std::cerr << path_
- << ": " << _("No XMP data found in the file
");
- return -3;
+ if (Params::instance().printItems_ & Params::prCount) {
+ if (!first) std::cout << " ";
+ first = false;
+ std::cout << std::dec << std::setw(3)
+ << std::setfill(' ') << std::right
+ << md.count();
}
- Exiv2::XmpData::const_iterator end = xmpData.end();
- Exiv2::XmpData::const_iterator md;
- bool const manyFiles = Params::instance().files_.size() > 1;
- for (md = xmpData.begin(); md != end; ++md) {
- std::cout << std::setfill(' ') << std::left;
- if (manyFiles) {
- std::cout << std::setw(20) << path_ << " ";
- }
- std::cout << std::setw(44)
- << md->key() << " "
- << std::setw(9) << std::setfill(' ') << std::left
- << md->typeName() << " "
- << std::dec << std::setw(3)
+ if (Params::instance().printItems_ & Params::prSize) {
+ if (!first) std::cout << " ";
+ first = false;
+ std::cout << std::dec << std::setw(3)
<< std::setfill(' ') << std::right
- << md->count() << " "
- << std::dec << *md
- << std::endl;
+ << md.size();
+ }
+ if (Params::instance().printItems_ & Params::prValue) {
+ if (!first) std::cout << " ";
+ first = false;
+ if ( Params::instance().binary_
+ && md.typeId() == Exiv2::undefined
+ && md.size() > 100) {
+ std::cout << _("(Binary value suppressed)") << std::endl;
+ return;
+ }
+ std::cout << std::dec << md.value();
+ }
+ if (Params::instance().printItems_ & Params::prTrans) {
+ if (!first) std::cout << " ";
+ first = false;
+ if ( Params::instance().binary_
+ && md.typeId() == Exiv2::undefined
+ && md.size() > 100) {
+ std::cout << _("(Binary value suppressed)") << std::endl;
+ return;
+ }
+ std::cout << std::dec << md.print(&pImage->exifData());
+ }
+ if (Params::instance().printItems_ & Params::prHex) {
+ if (!first) std::cout << std::endl;
+ first = false;
+ if ( Params::instance().binary_
+ && md.typeId() == Exiv2::undefined
+ && md.size() > 100) {
+ std::cout << _("(Binary value suppressed)") << std::endl;
+ return;
+ }
+ Exiv2::DataBuf buf(md.size());
+ md.copy(buf.pData_, pImage->byteOrder());
+ Exiv2::hexdump(std::cout, buf.pData_, buf.size_);
}
-
- return 0;
- } // Print::printXmp
+ std::cout << std::endl;
+ } // Print::printMetadatum
int Print::printComment()
{
diff --git a/src/actions.hpp b/src/actions.hpp
index 8873d85..de299a1 100644
--- a/src/actions.hpp
+++ b/src/actions.hpp
@@ -48,6 +48,7 @@
namespace Exiv2 {
class ExifData;
class Image;
+ class Metadatum;
class PreviewImage;
}
@@ -165,14 +166,14 @@ namespace Action {
int printComment();
//! Print list of available preview images
int printPreviewList();
- //! Print uninterpreted Iptc information
- int printIptc();
- //! print uninterpreted XMP information
- int printXmp();
//! Print Exif summary information
int printSummary();
- //! Print the list of Exif data in user defined format
+ //! Print Exif, IPTC and XMP metadata in user defined format
int printList();
+ //! Print a metadatum in a user defined format
+ void printMetadatum(const Exiv2::Metadatum& md,
+ const Exiv2::Image* pImage,
+ bool const manyFiles);
//! Print the label for a summary line
void printLabel(const std::string& label) const;
/*!
diff --git a/src/exif.hpp b/src/exif.hpp
index 53a2e8e..7443e5a 100644
--- a/src/exif.hpp
+++ b/src/exif.hpp
@@ -158,6 +158,8 @@ namespace Exiv2 {
//! Return the key of the %Exifdatum.
std::string key() const
{ return key_.get() == 0 ? "" : key_->key(); }
+ const char* familyName() const
+ { return key_.get() == 0 ? "" : key_->familyName(); }
std::string groupName() const
{ return key_.get() == 0 ? "" : key_->groupName(); }
std::string tagName() const
diff --git a/src/exiv2.1 b/src/exiv2.1
index e555ae3..9384742 100644
--- a/src/exiv2.1
+++ b/src/exiv2.1
@@ -3,7 +3,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
-.TH EXIV2 1 "Dec 7th, 2008"
+.TH EXIV2 1 "Dec 8th, 2008"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@@ -141,23 +141,32 @@ Print mode for the 'print' action. Possible modes are:
.br
s : print a summary of the Exif metadata (the default)
.br
-t : interpreted (translated) Exif data (shortcut for -Pkyct)
+a : print Exif, IPTC and XMP metadata (shortcut for -Pkyct)
.br
-v : plain Exif data values (shortcut for -Pxgnycv)
+t : interpreted (translated) Exif tags (-PEkyct)
.br
-h : hexdump of the Exif data (shortcut for -Pxgnycsh)
+v : plain Exif tag values (-PExgnycv)
.br
-i : IPTC data values
+h : hexdump of the Exif data (-PExgnycsh)
.br
-x : XMP properties
+i : IPTC datasets (-PIkyct)
+.br
+x : XMP properties (-PXkyct)
.br
c : JPEG comment
.br
p : list available image previews, sorted by preview image size in pixels
.TP
-.B \-P
Icols
P
-Print columns for the Exif taglist ('print' action), allows detailed
-control of the print output. Valid are:
+.B \-P
Iflgs
P
+Print flags for fine control of the tag list ('print' action). Allows
+control of the type of metadata as well as data columns included in
+the print output. Valid flags are:
+.br
+E : include Exif tags in the list
+.br
+I : IPTC datasets
+.br
+X : XMP properties
.br
x : print a column with the tag value
.br
diff --git a/src/exiv2.cpp b/src/exiv2.cpp
index ba67e69..68300da 100644
--- a/src/exiv2.cpp
+++ b/src/exiv2.cpp
@@ -263,14 +263,18 @@ void Params::help(std::ostream& os) const
<< _(" -D day Day adjustment with the 'adjust' action.
")
<< _(" -p mode Print mode for the 'print' action. Possible modes are:
")
<< _(" s : print a summary of the Exif metadata (the default)
")
- << _(" t : interpreted (translated) Exif data (shortcut for -Pkyct)
")
- << _(" v : plain Exif data values (shortcut for -Pxgnycv)
")
- << _(" h : hexdump of the Exif data (shortcut for -Pxgnycsh)
")
- << _(" i : IPTC data values
")
- << _(" x : XMP properties
")
+ << _(" a : print Exif, IPTC and XMP metadata (shortcut for -Pkyct)
")
+ << _(" t : interpreted (translated) Exif data (-PEkyct)
")
+ << _(" v : plain Exif data values (-PExgnycv)
")
+ << _(" h : hexdump of the Exif data (-PExgnycsh)
")
+ << _(" i : IPTC data values (-PIkyct)
")
+ << _(" x : XMP properties (-PXkyct)
")
<< _(" c : JPEG comment
")
<< _(" p : list available previews
")
- << _(" -P cols Print columns for the Exif taglist ('print' action). Valid are:
")
+ << _(" -P flgs Print flags for fine control of tag lists ('print' action):
")
+ << _(" E : include Exif tags in the list
")
+ << _(" I : IPTC datasets
")
+ << _(" X : XMP properties
")
<< _(" x : print a column with the tag value
")
<< _(" g : group name
")
<< _(" k : key
")
@@ -335,7 +339,7 @@ int Params::option(int opt, const std::string& optarg, int optopt)
case 'O': rc = evalYodAdjust(yodMonth, optarg); break;
case 'D': rc = evalYodAdjust(yodDay, optarg); break;
case 'p': rc = evalPrint(optarg); break;
- case 'P': rc = evalPrintCols(optarg); break;
+ case 'P': rc = evalPrintFlags(optarg); break;
case 'd': rc = evalDelete(optarg); break;
case 'e': rc = evalExtract(optarg); break;
case 'i': rc = evalInsert(optarg); break;
@@ -466,11 +470,12 @@ int Params::evalPrint(const std::string& optarg)
case Action::none:
switch (optarg[0]) {
case 's': printMode_ = pmSummary; break;
- case 't': rc = evalPrintCols("kyct"); break;
- case 'v': rc = evalPrintCols("xgnycv"); break;
- case 'h': rc = evalPrintCols("xgnycsh"); break;
- case 'i': printMode_ = pmIptc; break;
- case 'x': printMode_ = pmXmp; break;
+ case 'a': rc = evalPrintFlags("kyct"); break;
+ case 't': rc = evalPrintFlags("Ekyct"); break;
+ case 'v': rc = evalPrintFlags("Exgnycv"); break;
+ case 'h': rc = evalPrintFlags("Exgnycsh"); break;
+ case 'i': rc = evalPrintFlags("Ikyct"); break;
+ case 'x': rc = evalPrintFlags("Xkyct"); break;
case 'c': printMode_ = pmComment; break;
case 'p': printMode_ = pmPreview; break;
default:
@@ -493,15 +498,18 @@ int Params::evalPrint(const std::string& optarg)
return rc;
} // Params::evalPrint
-int Params::evalPrintCols(const std::string& optarg)
+int Params::evalPrintFlags(const std::string& optarg)
{
int rc = 0;
+ printMode_ = pmList;
switch (action_) {
case Action::none:
action_ = Action::print;
- printMode_ = pmList;
for (std::size_t i = 0; i < optarg.length(); ++i) {
switch (optarg[i]) {
+ case 'E': printTags_ |= Exiv2::mdExif; break;
+ case 'I': printTags_ |= Exiv2::mdIptc; break;
+ case 'X': printTags_ |= Exiv2::mdXmp; break;
case 'x': printItems_ |= prTag; break;
case 'g': printItems_ |= prGroup; break;
case 'k': printItems_ |= prKey; break;
@@ -532,7 +540,7 @@ int Params::evalPrintCols(const std::string& optarg)
break;
}
return rc;
-} // Params::evalPrintCols
+} // Params::evalPrintFlags
int Params::evalDelete(const std::string& optarg)
{
diff --git a/src/exiv2.hpp b/src/exiv2.hpp
index 751ec24..8fd1f9f 100644
--- a/src/exiv2.hpp
+++ b/src/exiv2.hpp
@@ -126,9 +126,14 @@ public:
void cleanup();
//! Enumerates print modes
- enum PrintMode { pmSummary, pmList, pmIptc, pmXmp, pmComment, pmPreview };
+ enum PrintMode {
+ pmSummary,
+ pmList,
+ pmComment,
+ pmPreview
+ };
- //! Individual items to print
+ //! Individual items to print, bitmap
enum PrintItem {
prTag = 1,
prGroup = 2,
@@ -180,6 +185,7 @@ public:
bool adjust_; //!< Adjustment flag.
PrintMode printMode_; //!< Print mode.
unsigned long printItems_; //!< Print items.
+ unsigned long printTags_; //!< Print tags (bitmap of MetadataId flags).
//! %Action (integer rather than TaskType to avoid dependency).
int action_;
int target_; //!< What common target to process.
@@ -224,6 +230,7 @@ private:
adjust_(false),
printMode_(pmSummary),
printItems_(0),
+ printTags_(Exiv2::mdNone),
action_(0),
target_(ctExif|ctIptc|ctComment|ctXmp),
adjustment_(0),
@@ -245,7 +252,7 @@ private:
int evalAdjust(const std::string& optarg);
int evalYodAdjust(const Yod& yod, const std::string& optarg);
int evalPrint(const std::string& optarg);
- int evalPrintCols(const std::string& optarg);
+ int evalPrintFlags(const std::string& optarg);
int evalDelete(const std::string& optarg);
int evalExtract(const std::string& optarg);
int evalInsert(const std::string& optarg);
diff --git a/src/iptc.hpp b/src/iptc.hpp
index 465a2ff..5680deb 100644
--- a/src/iptc.hpp
+++ b/src/iptc.hpp
@@ -124,7 +124,7 @@ namespace Exiv2 {
*/
std::string key() const { return key_.get() == 0 ? "" : key_->key(); }
/*!
- @brief Return the name of the record
+ @brief Return the name of the record (deprecated)
@return record name
*/
std::string recordName() const
@@ -135,6 +135,10 @@ namespace Exiv2 {
*/
uint16_t record() const
{ return key_.get() == 0 ? 0 : key_->record(); }
+ const char* familyName() const
+ { return key_.get() == 0 ? "" : key_->familyName(); }
+ std::string groupName() const
+ { return key_.get() == 0 ? "" : key_->groupName(); }
/*!
@brief Return the name of the tag (aka dataset)
@return tag name
diff --git a/src/metadatum.hpp b/src/metadatum.hpp
index 2a6d7b9..7eb369f 100644
--- a/src/metadatum.hpp
+++ b/src/metadatum.hpp
@@ -203,11 +203,15 @@ namespace Exiv2 {
) const =0;
/*!
@brief Return the key of the metadatum. The key is of the form
- 'familyName.ifdItem.tagName'. Note however that the key
- is not necessarily unique, i.e., an ExifData object may
+ 'familyName.groupName.tagName'. Note however that the key
+ is not necessarily unique, e.g., an ExifData object may
contain multiple metadata with the same key.
*/
virtual std::string key() const =0;
+ //! Return the name of the metadata family (which is also the first part of the key)
+ virtual const char* familyName() const =0;
+ //! Return the name of the metadata group (which is also the second part of the key)
+ virtual std::string groupName() const =0;
//! Return the name of the tag (which is also the third part of the key)
virtual std::string tagName() const =0;
//! Return a label for the tag
diff --git a/src/xmp.cpp b/src/xmp.cpp
index c408b24..20b201f 100644
--- a/src/xmp.cpp
+++ b/src/xmp.cpp
@@ -168,6 +168,11 @@ namespace Exiv2 {
return p_->key_.get() == 0 ? "" : p_->key_->key();
}
+ const char* Xmpdatum::familyName() const
+ {
+ return p_->key_.get() == 0 ? "" : p_->key_->familyName();
+ }
+
std::string Xmpdatum::groupName() const
{
return p_->key_.get() == 0 ? "" : p_->key_->groupName();
diff --git a/src/xmp.hpp b/src/xmp.hpp
index d8e15bd..fecbadc 100644
--- a/src/xmp.hpp
+++ b/src/xmp.hpp
@@ -132,6 +132,7 @@ namespace Exiv2 {
contain multiple metadata with the same key.
*/
std::string key() const;
+ const char* familyName() const;
//! Return the (preferred) schema namespace prefix.
std::string groupName() const;
//! Return the property name.
diff --git a/test/conversions.sh b/test/conversions.sh
index e16f1b1..f93c679 100755
--- a/test/conversions.sh
+++ b/test/conversions.sh
@@ -30,7 +30,7 @@ $exiv2 -M'set Exif.Image.ImageDescription The Exif image description' h.jpg
rm -f h.xmp
$exiv2 -eX h.jpg
$exiv2 -px h.xmp
-$exiv2 -Pkycv h.xmp
+$exiv2 -PEkycv h.xmp
$exiv2 -pi h.xmp
# 2) Convert XMP x-default langAlt value back to Exif ImageDescription
@@ -41,7 +41,7 @@ echo ==========
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list