diff --git a/src/actions.cpp b/src/actions.cpp index 6f2a105d..f5abaea1 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\n"); - 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\n"); - 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\n"); } + 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\n"); } - 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\n"); } - 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\n"); - 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\n"); - 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\n"); - 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\n"); - 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 8873d855..de299a15 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 53a2e8e9..7443e5af 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 e555ae3b..93847420 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 \fIcols\fP -Print columns for the Exif taglist ('print' action), allows detailed -control of the print output. Valid are: +.B \-P \fIflgs\fP +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 ba67e692..68300dab 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.\n") << _(" -p mode Print mode for the 'print' action. Possible modes are:\n") << _(" s : print a summary of the Exif metadata (the default)\n") - << _(" t : interpreted (translated) Exif data (shortcut for -Pkyct)\n") - << _(" v : plain Exif data values (shortcut for -Pxgnycv)\n") - << _(" h : hexdump of the Exif data (shortcut for -Pxgnycsh)\n") - << _(" i : IPTC data values\n") - << _(" x : XMP properties\n") + << _(" a : print Exif, IPTC and XMP metadata (shortcut for -Pkyct)\n") + << _(" t : interpreted (translated) Exif data (-PEkyct)\n") + << _(" v : plain Exif data values (-PExgnycv)\n") + << _(" h : hexdump of the Exif data (-PExgnycsh)\n") + << _(" i : IPTC data values (-PIkyct)\n") + << _(" x : XMP properties (-PXkyct)\n") << _(" c : JPEG comment\n") << _(" p : list available previews\n") - << _(" -P cols Print columns for the Exif taglist ('print' action). Valid are:\n") + << _(" -P flgs Print flags for fine control of tag lists ('print' action):\n") + << _(" E : include Exif tags in the list\n") + << _(" I : IPTC datasets\n") + << _(" X : XMP properties\n") << _(" x : print a column with the tag value\n") << _(" g : group name\n") << _(" k : key\n") @@ -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 751ec240..8fd1f9f1 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 465a2fff..5680debb 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 2a6d7b9b..7eb369fd 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 c408b241..20b201f6 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 d8e15bdb..fecbadc0 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 e16f1b17..f93c679b 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 ========== \cp h.xmp i.xmp $exiv2 -iX i.jpg $exiv2 -px i.jpg -$exiv2 -Pkycv i.jpg +$exiv2 -PEkycv i.jpg $exiv2 -pi i.jpg # 3) Convert XMP single non-x-default langAlt value to Exif ImageDescription @@ -52,7 +52,7 @@ sed s/x-default/de-DE/ i.xmp > j.xmp \cp $IMG j.jpg $exiv2 -iX j.jpg $exiv2 -px j.jpg -$exiv2 -Pkycv j.jpg +$exiv2 -PEkycv j.jpg $exiv2 -pi j.jpg # 4) This shouldn't work: No x-default, more than one language @@ -63,8 +63,8 @@ sed 's,The Exif image description, $results 2>&1 diff --git a/test/data/conversions.out b/test/data/conversions.out index 223b0a44..5154bb9f 100644 --- a/test/data/conversions.out +++ b/test/data/conversions.out @@ -21,7 +21,9 @@ Testcase 4 Warning: Failed to convert Xmp.dc.description to Iptc.Application2.Caption Warning: Failed to convert Xmp.dc.description to Exif.Image.ImageDescription Xmp.dc.description LangAlt 2 lang="de-DE" The Exif image description, lang="it-IT" Ciao bella +File 1/1: k.jpg k.jpg: No Exif data found in the file +File 1/1: k.jpg k.jpg: No IPTC data found in the file Testcase 5 @@ -39,6 +41,7 @@ Exif.Image.ExifTag Long 1 26 Exif.Photo.UserComment Undefined 59 charset="Jis" This is a JIS encoded Exif user comment. Or was it? Xmp.exif.UserComment LangAlt 1 lang="x-default" This is a JIS encoded Exif user comment. Or was it? Exif.Photo.UserComment Undefined 59 charset="Unicode" This is a JIS encoded Exif user comment. Or was it? +File 1/1: m.xmp m.xmp: No IPTC data found in the file Testcase 7 @@ -46,6 +49,7 @@ Testcase 7 Xmp.exif.UserComment LangAlt 1 lang="x-default" This is a JIS encoded Exif user comment. Or was it? Exif.Image.ExifTag Long 1 26 Exif.Photo.UserComment Undefined 59 charset="Unicode" This is a JIS encoded Exif user comment. Or was it? +File 1/1: n.jpg n.jpg: No IPTC data found in the file Testcase 8 @@ -54,6 +58,7 @@ Iptc.Application2.Keywords String 3 Sex Iptc.Application2.Keywords String 5 Drugs Iptc.Application2.Keywords String 11 Rock'n'roll Xmp.dc.subject XmpBag 3 Sex, Drugs, Rock'n'roll +File 1/1: o.xmp o.xmp: No Exif data found in the file Iptc.Application2.Keywords String 3 Sex Iptc.Application2.Keywords String 5 Drugs @@ -62,6 +67,7 @@ Iptc.Application2.Keywords String 11 Rock'n'roll Testcase 9 ========== Xmp.dc.subject XmpBag 3 Sex, Drugs, Rock'n'roll +File 1/1: p.jpg p.jpg: No Exif data found in the file Iptc.Application2.Keywords String 3 Sex Iptc.Application2.Keywords String 5 Drugs @@ -72,24 +78,28 @@ Testcase 10 Exif.Image.Software Ascii 6 Exiv2 Xmp.tiff.Software XmpText 5 Exiv2 Exif.Image.Software Ascii 6 Exiv2 +File 1/1: q.xmp q.xmp: No IPTC data found in the file Testcase 11 =========== Xmp.tiff.Software XmpText 5 Exiv2 Exif.Image.Software Ascii 6 Exiv2 +File 1/1: r.jpg r.jpg: No IPTC data found in the file Testcase 12 =========== Iptc.Application2.LocationName String 12 Kuala Lumpur Xmp.iptc.Location XmpText 12 Kuala Lumpur +File 1/1: s.xmp s.xmp: No Exif data found in the file Iptc.Application2.LocationName String 12 Kuala Lumpur Testcase 13 =========== Xmp.iptc.Location XmpText 12 Kuala Lumpur +File 1/1: t.jpg t.jpg: No Exif data found in the file Iptc.Application2.LocationName String 12 Kuala Lumpur diff --git a/test/data/exiv2-test.out b/test/data/exiv2-test.out index f602829e..3536c071 100644 --- a/test/data/exiv2-test.out +++ b/test/data/exiv2-test.out @@ -62,14 +62,18 @@ Options: -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