Minor changes

v0.27.3
Andreas Huggel 22 years ago
parent 1f94309899
commit e9d0aea8e5

@ -20,13 +20,13 @@
*/ */
/* /*
File: actions.cpp File: actions.cpp
Version: $Name: $ $Revision: 1.6 $ Version: $Name: $ $Revision: 1.7 $
Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
History: 08-Dec-03, ahu: created History: 08-Dec-03, ahu: created
*/ */
// ***************************************************************************** // *****************************************************************************
#include "rcsid.hpp" #include "rcsid.hpp"
EXIV2_RCSID("@(#) $Name: $ $Revision: 1.6 $ $RCSfile: actions.cpp,v $") EXIV2_RCSID("@(#) $Name: $ $Revision: 1.7 $ $RCSfile: actions.cpp,v $")
// ***************************************************************************** // *****************************************************************************
// included header files // included header files
@ -243,7 +243,7 @@ namespace Action {
for (md = exifData.begin(); md != exifData.end(); ++md) { for (md = exifData.begin(); md != exifData.end(); ++md) {
std::cout << "0x" << std::setw(4) << std::setfill('0') << std::right std::cout << "0x" << std::setw(4) << std::setfill('0') << std::right
<< std::hex << md->tag() << " " << std::hex << md->tag() << " "
<< std::setw(4) << std::setfill(' ') << std::left << std::setw(9) << std::setfill(' ') << std::left
<< md->ifdName() << " " << md->ifdName() << " "
<< std::setw(9) << std::setfill(' ') << std::left << std::setw(9) << std::setfill(' ') << std::left
<< md->typeName() << " " << md->typeName() << " "

@ -4,7 +4,7 @@
/*! /*!
@file doxygen.hpp @file doxygen.hpp
@brief Additional documentation, this file contains no source code @brief Additional documentation, this file contains no source code
@version $Name: $ $Revision: 1.2 $ @version $Name: $ $Revision: 1.3 $
@author Andreas Huggel (ahu) @author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a> <a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 07-Feb-04, ahu: created @date 07-Feb-04, ahu: created
@ -24,7 +24,7 @@
Exiv2 is also a C++ %Exif metadata library, providing high-level access to the Exiv2 is also a C++ %Exif metadata library, providing high-level access to the
%Exif data of an image. Supported functionality includes %Exif data of an image. Supported functionality includes
- read %Exif information from JPEG files - read %Exif information from JPEG files
- access metadata through unique keys and standard C++ iterators - access metadata through keys and standard C++ iterators
- add, modify and delete metadata - add, modify and delete metadata
- write %Exif data to JPEG files - write %Exif data to JPEG files
- extract %Exif metadata to files, insert from these files - extract %Exif metadata to files, insert from these files

@ -3,7 +3,7 @@
Abstract: Example showing how to add, modify and delete Exif metadata Abstract: Example showing how to add, modify and delete Exif metadata
File: example1.cpp File: example1.cpp
Version: $Name: $ $Revision: 1.4 $ Version: $Name: $ $Revision: 1.5 $
Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
History: 26-Jan-04, ahu: created History: 26-Jan-04, ahu: created
*/ */
@ -67,6 +67,8 @@ try {
std::string date = pos->toString(); std::string date = pos->toString();
date.replace(0,4,"2000"); date.replace(0,4,"2000");
pos->setValue(date); pos->setValue(date);
std::cout << "Modified key \"" << key
<< "\", new value \"" << pos->value() << "\"\n";
// Find the other key // Find the other key
key = "Image.ImageCharacteristics.PrimaryChromaticities"; key = "Image.ImageCharacteristics.PrimaryChromaticities";
@ -83,6 +85,8 @@ try {
pos->setValue(rv); pos->setValue(rv);
// Delete the memory allocated by getValue // Delete the memory allocated by getValue
delete v; delete v;
std::cout << "Modified key \"" << key
<< "\", new value \"" << pos->value() << "\"\n";
std::cout << "---\n"; std::cout << "---\n";
exifPrint(exifData); exifPrint(exifData);
@ -90,16 +94,13 @@ try {
// ************************************************************************* // *************************************************************************
// Delete metadata from the Exif data container // Delete metadata from the Exif data container
// Delete a metadatum by its key
key = "Image.DateTime.DateTimeOriginal";
exifData.erase(key);
// Delete the metadatum at iterator position pos // Delete the metadatum at iterator position pos
key = "Image.ImageCharacteristics.PrimaryChromaticities"; key = "Image.ImageCharacteristics.PrimaryChromaticities";
pos = exifData.findKey(key); pos = exifData.findKey(key);
if (pos == exifData.end()) throw Exif::Error("Key not found"); if (pos == exifData.end()) throw Exif::Error("Key not found");
exifData.erase(pos); exifData.erase(pos);
std::cout << "Deleted key \"" << key << "\"\n";
std::cout << "---\n"; std::cout << "---\n";
exifPrint(exifData); exifPrint(exifData);

Loading…
Cancel
Save