libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 359e1cebe71cc74882e03c25269a7d72e1d7a819
parent 551e0ed34e2764c99356ee27f3178363dde3711c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat,  9 Jul 2005 14:06:45 +0000

update

Diffstat:
Msrc/plugins/exiv2/canonmn.cpp | 9+++------
Msrc/plugins/exiv2/exif.cpp | 13++++++++++---
Msrc/plugins/exiv2/exif.hpp | 5++---
Msrc/plugins/exiv2/exiv2.cpp | 14++++++++++++--
Msrc/plugins/exiv2/exiv2.hpp | 4+++-
Msrc/plugins/exiv2/exv_conf.h | 2++
Msrc/plugins/exiv2/fujimn.cpp | 7++-----
Msrc/plugins/exiv2/ifd.cpp | 16++++++++++------
Msrc/plugins/exiv2/image.cpp | 24++++++++++++++++++++++--
Msrc/plugins/exiv2/image.hpp | 34+++++++++++++++++++++++++++++++++-
Msrc/plugins/exiv2/iptc.cpp | 13++++++++-----
Msrc/plugins/exiv2/iptc.hpp | 5++---
Msrc/plugins/exiv2/makernote.cpp | 44++++++++++++++++++++++++++++++++++++++++++--
Msrc/plugins/exiv2/makernote.hpp | 35++++++++++++++++++++++++++++++++++-
Msrc/plugins/exiv2/metacopy.cpp | 2--
Msrc/plugins/exiv2/olympusmn.cpp | 7++-----
Msrc/plugins/exiv2/panasonicmn.cpp | 7++-----
Msrc/plugins/exiv2/sigmamn.cpp | 7++-----
Msrc/plugins/exiv2/sonymn.cpp | 7++-----
Msrc/plugins/exiv2/tags.cpp | 11+++++++----
20 files changed, 200 insertions(+), 66 deletions(-)

diff --git a/src/plugins/exiv2/canonmn.cpp b/src/plugins/exiv2/canonmn.cpp @@ -20,7 +20,7 @@ */ /* File: canonmn.cpp - Version: $Rev: 569 $ + Version: $Rev: 600 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> History: 18-Feb-04, ahu: created 07-Mar-04, ahu: isolated as a separate component @@ -30,7 +30,7 @@ */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: canonmn.cpp 569 2005-05-28 05:48:43Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: canonmn.cpp 600 2005-07-09 10:38:09Z ahuggel $"); // ***************************************************************************** // included header files @@ -49,9 +49,6 @@ EXIV2_RCSID("@(#) $Id: canonmn.cpp 569 2005-05-28 05:48:43Z ahuggel $"); #include <cstring> #include <cmath> -// Define DEBUG_MAKERNOTE to output debug information to std::cerr -#undef DEBUG_MAKERNOTE - // ***************************************************************************** // local declarations namespace { @@ -90,7 +87,7 @@ namespace Exiv2 { canonCs2IfdId, MakerNote::AutoPtr(new CanonMakerNote)); MakerNoteFactory::registerMakerNote( canonCfIfdId, MakerNote::AutoPtr(new CanonMakerNote)); - + ExifTags::registerMakerTagInfo(canonIfdId, tagInfo_); ExifTags::registerMakerTagInfo(canonCs1IfdId, tagInfoCs1_); ExifTags::registerMakerTagInfo(canonCs2IfdId, tagInfoCs2_); diff --git a/src/plugins/exiv2/exif.cpp b/src/plugins/exiv2/exif.cpp @@ -20,14 +20,14 @@ */ /* File: exif.cpp - Version: $Rev: 569 $ + Version: $Rev: 600 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> History: 26-Jan-04, ahu: created 11-Feb-04, ahu: isolated as a component */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: exif.cpp 569 2005-05-28 05:48:43Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: exif.cpp 600 2005-07-09 10:38:09Z ahuggel $"); // Define DEBUG_MAKERNOTE to output debug information to std::cerr, e.g, by // calling make like this: make DEFS=-DDEBUG_MAKERNOTE exif.o @@ -114,6 +114,12 @@ namespace Exiv2 { if (rhs.value_.get() != 0) value_ = rhs.value_->clone(); // deep copy } + const Value& Exifdatum::value() const + { + if (value_.get() == 0) throw Error(8); + return *value_; + } + Exifdatum& Exifdatum::operator=(const Exifdatum& rhs) { if (this == &rhs) return *this; @@ -497,9 +503,10 @@ namespace Exiv2 { byteOrder(), pExifIfd_->offset() + pos->offset()); if (rc) { - // Todo: How to handle debug output like this +#ifndef SUPPRESS_WARNINGS std::cerr << "Warning: Failed to read Makernote, rc = " << rc << "\n"; +#endif delete pMakerNote_; pMakerNote_ = 0; } diff --git a/src/plugins/exiv2/exif.hpp b/src/plugins/exiv2/exif.hpp @@ -21,7 +21,7 @@ /*! @file exif.hpp @brief Encoding and decoding of Exif data - @version $Rev: 560 $ + @version $Rev: 599 $ @author Andreas Huggel (ahu) <a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a> @date 09-Jan-04, ahu: created @@ -283,8 +283,7 @@ namespace Exiv2 { @return A constant reference to the value. @throw Error if the value is not set. */ - const Value& value() const - { if (value_.get() != 0) return *value_; throw Error(8); } + const Value& value() const; //! Return the size of the data area. long sizeDataArea() const { return value_.get() == 0 ? 0 : value_->sizeDataArea(); } diff --git a/src/plugins/exiv2/exiv2.cpp b/src/plugins/exiv2/exiv2.cpp @@ -22,13 +22,13 @@ Abstract: Command line program to display and manipulate image %Exif data File: exiv2.cpp - Version: $Rev: 575 $ + Version: $Rev: 598 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> History: 10-Dec-03, ahu: created */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: exiv2.cpp 575 2005-06-04 07:32:20Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: exiv2.cpp 598 2005-07-08 15:29:11Z ahuggel $"); // ***************************************************************************** // included header files @@ -142,6 +142,10 @@ int main(int argc, char* const argv[]) } task->run(*i); } + + taskFactory.cleanup(); + params.cleanup(); + return 0; } // main @@ -157,6 +161,12 @@ Params& Params::instance() return *instance_; } +void Params::cleanup() +{ + delete instance_; + instance_ = 0; +} + void Params::version(std::ostream& os) const { os << EXV_PACKAGE_STRING << ", " diff --git a/src/plugins/exiv2/exiv2.hpp b/src/plugins/exiv2/exiv2.hpp @@ -21,7 +21,7 @@ /*! @file exiv2.hpp @brief Defines class Params, used for the command line handling of exiv2 - @version $Rev: 567 $ + @version $Rev: 598 $ @author Andreas Huggel (ahu) <a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a> @date 08-Dec-03, ahu: created @@ -119,6 +119,8 @@ public: @return Reference to the global Params instance. */ static Params& instance(); + //! Destructor + void cleanup(); //! Enumerates print modes enum PrintMode { pmSummary, pmInterpreted, pmValues, pmHexdump, pmIptc, diff --git a/src/plugins/exiv2/exv_conf.h b/src/plugins/exiv2/exv_conf.h @@ -9,6 +9,8 @@ /* Define to 1 if using `alloca.c'. */ /* #undef EXV_C_ALLOCA */ +#define SUPPRESS_WARNINGS 1 + /* Define to 1 if you have the `alarm' function. */ #define EXV_HAVE_ALARM 1 diff --git a/src/plugins/exiv2/fujimn.cpp b/src/plugins/exiv2/fujimn.cpp @@ -20,7 +20,7 @@ */ /* File: fujimn.cpp - Version: $Rev: 569 $ + Version: $Rev: 600 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> History: 18-Feb-04, ahu: created 07-Mar-04, ahu: isolated as a separate component @@ -31,7 +31,7 @@ */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: fujimn.cpp 569 2005-05-28 05:48:43Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: fujimn.cpp 600 2005-07-09 10:38:09Z ahuggel $"); // ***************************************************************************** // included header files @@ -46,9 +46,6 @@ EXIV2_RCSID("@(#) $Id: fujimn.cpp 569 2005-05-28 05:48:43Z ahuggel $"); #include <iomanip> #include <cassert> -// Define DEBUG_MAKERNOTE to output debug information to std::cerr -#undef DEBUG_MAKERNOTE - // ***************************************************************************** // class member definitions namespace Exiv2 { diff --git a/src/plugins/exiv2/ifd.cpp b/src/plugins/exiv2/ifd.cpp @@ -20,14 +20,14 @@ */ /* File: ifd.cpp - Version: $Rev: 562 $ + Version: $Rev: 600 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> History: 26-Jan-04, ahu: created 11-Feb-04, ahu: isolated as a component */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: ifd.cpp 562 2005-04-20 18:16:29Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: ifd.cpp 600 2005-07-09 10:38:09Z ahuggel $"); // ***************************************************************************** // included header files @@ -313,10 +313,11 @@ namespace Exiv2 { for (int i = 0; i < n; ++i) { if (len < o + 12) { - // Todo: How to handle debug output like this +#ifndef SUPPRESS_WARNINGS std::cerr << "Error: " << ExifTags::ifdName(ifdId_) << " entry " << i << " lies outside of the IFD memory buffer.\n"; +#endif rc = 6; break; } @@ -333,10 +334,11 @@ namespace Exiv2 { } if (rc == 0 && hasNext_) { if (len < o + 4) { - // Todo: How to handle debug output like this +#ifndef SUPPRESS_WARNINGS std::cerr << "Error: " << ExifTags::ifdName(ifdId_) << " memory of the pointer to the next IFD" << " lies outside of the IFD memory buffer.\n"; +#endif rc = 6; } else { @@ -369,7 +371,7 @@ namespace Exiv2 { } // Set the offset of the first data entry outside of the IFD if (i->offset_ - offset_ >= len) { - // Todo: How to handle debug output like this +#ifndef SUPPRESS_WARNINGS std::cerr << "Error: Offset of the 1st data entry of " << ExifTags::ifdName(ifdId_) << " is out of bounds:\n" @@ -379,6 +381,7 @@ namespace Exiv2 { << ", exceeds buffer size by " << std::dec << i->offset_ - len << " Bytes\n"; +#endif rc = 6; } else { @@ -402,7 +405,7 @@ namespace Exiv2 { long tmpOffset = i->size_ > 4 ? i->offset_ - offset_ : i->offsetLoc_; if (tmpOffset + i->size_ > len) { - // Todo: How to handle debug output like this +#ifndef SUPPRESS_WARNINGS std::cerr << "Warning: Upper boundary of data for " << ExifTags::ifdName(ifdId_) << " entry " << static_cast<int>(i - begin) @@ -414,6 +417,7 @@ namespace Exiv2 { << ", exceeds buffer size by " << tmpOffset + i->size_ - len << " Bytes; Truncating the data.\n"; +#endif // Truncate the entry i->size_ = 0; i->count_ = 0; diff --git a/src/plugins/exiv2/image.cpp b/src/plugins/exiv2/image.cpp @@ -20,7 +20,7 @@ */ /* File: image.cpp - Version: $Rev: 563 $ + Version: $Rev: 598 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> Brad Schick (brad) <brad@robotbattle.com> History: 26-Jan-04, ahu: created @@ -30,7 +30,7 @@ */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: image.cpp 563 2005-04-21 07:21:53Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: image.cpp 598 2005-07-08 15:29:11Z ahuggel $"); // ***************************************************************************** // included header files @@ -66,8 +66,28 @@ EXIV2_RCSID("@(#) $Id: image.cpp 563 2005-04-21 07:21:53Z ahuggel $"); // class member definitions namespace Exiv2 { + int ImageFactory::Init::count = 0; + + ImageFactory::Init::Init() + { + ++count; + } + + ImageFactory::Init::~Init() + { + if (--count == 0) { + Exiv2::ImageFactory::cleanup(); + } + } + ImageFactory::Registry* ImageFactory::registry_ = 0; + void ImageFactory::cleanup() + { + delete registry_; + registry_ = 0; + } + void ImageFactory::init() { if (0 == registry_) { diff --git a/src/plugins/exiv2/image.hpp b/src/plugins/exiv2/image.hpp @@ -21,7 +21,7 @@ /*! @file image.hpp @brief Class JpegImage to access JPEG images - @version $Rev: 563 $ + @version $Rev: 598 $ @author Andreas Huggel (ahu) <a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a> @author Brad Schick (brad) @@ -252,6 +252,8 @@ namespace Exiv2 { public: //! @name Manipulators //@{ + //! Destructor. + static void cleanup(); /*! @brief Register image type together with its function pointers. @@ -372,6 +374,24 @@ namespace Exiv2 { static Image::Type getType(BasicIo& io); //@} + /*! + @brief Class Init is used to execute initialisation and termination + code exactly once, at the begin and end of the program. + + See Bjarne Stroustrup, 'The C++ Programming Language 3rd + Edition', section 21.5.2 for details about this pattern. + */ + class Init { + static int count; //!< Counts calls to constructor + public: + //! @name Creators + //@{ + //! Perform one-time initialisations. + Init(); + //! Perform one-time cleanup operations. + ~Init(); + //@} + }; private: //! @name Creators @@ -458,4 +478,16 @@ namespace Exiv2 { } // namespace Exiv2 +namespace { + /*! + Each translation unit that includes image.hpp declares its own + Init object. The destructor ensures that the factory is properly + freed exactly once. + + See Bjarne Stroustrup, 'The C++ Programming Language 3rd + Edition', section 21.5.2 for details about this pattern. + */ + Exiv2::ImageFactory::Init imageFactoryInit; +} + #endif // #ifndef IMAGE_HPP_ diff --git a/src/plugins/exiv2/iptc.cpp b/src/plugins/exiv2/iptc.cpp @@ -20,16 +20,13 @@ */ /* File: iptc.cpp - Version: $Rev: 560 $ + Version: $Rev: 600 $ Author(s): Brad Schick (brad) <brad@robotbattle.com> History: 31-July-04, brad: created */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: iptc.cpp 560 2005-04-17 11:51:32Z ahuggel $"); - -// Define DEBUG_MAKERNOTE to output debug information to std::cerr -#undef DEBUG_MAKERNOTE +EXIV2_RCSID("@(#) $Id: iptc.cpp 600 2005-07-09 10:38:09Z ahuggel $"); // ***************************************************************************** // included header files @@ -66,6 +63,12 @@ namespace Exiv2 { { } + const Value& Iptcdatum::value() const + { + if (value_.get() == 0) throw Error(8); + return *value_; + } + Iptcdatum& Iptcdatum::operator=(const Iptcdatum& rhs) { if (this == &rhs) return *this; diff --git a/src/plugins/exiv2/iptc.hpp b/src/plugins/exiv2/iptc.hpp @@ -21,7 +21,7 @@ /*! @file iptc.hpp @brief Encoding and decoding of Iptc data - @version $Rev: 560 $ + @version $Rev: 599 $ @author Brad Schick (brad) <a href="mailto:brad@robotbattle.com">brad@robotbattle.com</a> @date 31-Jul-04, brad: created @@ -226,8 +226,7 @@ namespace Exiv2 { @return A constant reference to the value. @throw Error If the value is not set. */ - const Value& value() const - { if (value_.get() != 0) return *value_; throw Error(8); } + const Value& value() const; //@} private: diff --git a/src/plugins/exiv2/makernote.cpp b/src/plugins/exiv2/makernote.cpp @@ -20,13 +20,13 @@ */ /* File: makernote.cpp - Version: $Rev: 579 $ + Version: $Rev: 600 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> History: 18-Feb-04, ahu: created */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: makernote.cpp 579 2005-06-11 04:11:23Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: makernote.cpp 600 2005-07-09 10:38:09Z ahuggel $"); // Define DEBUG_* to output debug information to std::cerr, e.g, by calling // make like this: make DEFS=-DDEBUG_MAKERNOTE makernote.o @@ -103,9 +103,11 @@ namespace Exiv2 { if (rc == 0) { // IfdMakerNote currently does not support multiple IFDs if (ifd_.next() != 0) { +#ifndef SUPPRESS_WARNINGS std::cerr << "Warning: Makernote IFD has a next pointer != 0 (" << ifd_.next() << "). Ignored.\n"; +#endif } } #ifdef DEBUG_MAKERNOTE @@ -184,9 +186,42 @@ namespace Exiv2 { return AutoPtr(clone_()); } + int MakerNoteFactory::Init::count = 0; + + MakerNoteFactory::Init::Init() + { + ++count; + } + + MakerNoteFactory::Init::~Init() + { + if (--count == 0) { + Exiv2::MakerNoteFactory::cleanup(); + } + } + MakerNoteFactory::Registry* MakerNoteFactory::pRegistry_ = 0; MakerNoteFactory::IfdIdRegistry* MakerNoteFactory::pIfdIdRegistry_ = 0; + void MakerNoteFactory::cleanup() + { + if (pRegistry_ != 0) { + Registry::iterator e = pRegistry_->end(); + for (Registry::iterator i = pRegistry_->begin(); i != e; ++i) { + delete i->second; + } + delete pRegistry_; + } + + if (pIfdIdRegistry_ != 0) { + IfdIdRegistry::iterator e = pIfdIdRegistry_->end(); + for (IfdIdRegistry::iterator i = pIfdIdRegistry_->begin(); i != e; ++i) { + delete i->second; + } + delete pIfdIdRegistry_; + } + } + void MakerNoteFactory::init() { if (0 == pRegistry_) { @@ -203,6 +238,11 @@ namespace Exiv2 { init(); MakerNote* pMakerNote = makerNote.release(); assert(pMakerNote); + IfdIdRegistry::iterator pos = pIfdIdRegistry_->find(ifdId); + if (pos != pIfdIdRegistry_->end()) { + delete pos->second; + pos->second = 0; + } (*pIfdIdRegistry_)[ifdId] = pMakerNote; } // MakerNoteFactory::registerMakerNote diff --git a/src/plugins/exiv2/makernote.hpp b/src/plugins/exiv2/makernote.hpp @@ -22,7 +22,7 @@ @file makernote.hpp @brief Contains the Exif %MakerNote interface, IFD %MakerNote and a MakerNote factory - @version $Rev: 569 $ + @version $Rev: 598 $ @author Andreas Huggel (ahu) <a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a> @date 18-Feb-04, ahu: created @@ -344,6 +344,8 @@ namespace Exiv2 { */ class MakerNoteFactory { public: + //! Destructor. + static void cleanup(); /*! @brief Register a %MakerNote create function for a camera make and model. @@ -442,6 +444,25 @@ namespace Exiv2 { */ static int match(const std::string& regEntry, const std::string& key); + /*! + @brief Class Init is used to execute initialisation and termination + code exactly once, at the begin and end of the program. + + See Bjarne Stroustrup, 'The C++ Programming Language 3rd + Edition', section 21.5.2 for details about this pattern. + */ + class Init { + static int count; //!< Counts calls to constructor + public: + //! @name Creators + //@{ + //! Perform one-time initialisations. + Init(); + //! Perform one-time cleanup operations. + ~Init(); + //@} + }; + private: //! @name Creators //@{ @@ -471,4 +492,16 @@ namespace Exiv2 { } // namespace Exiv2 +namespace { + /*! + Each translation unit that includes makernote.hpp declares its own + Init object. The destructor ensures that the factory is properly + freed exactly once. + + See Bjarne Stroustrup, 'The C++ Programming Language 3rd + Edition', section 21.5.2 for details about this pattern. + */ + Exiv2::MakerNoteFactory::Init makerNoteFactoryInit; +} + #endif // #ifndef MAKERNOTE_HPP_ diff --git a/src/plugins/exiv2/metacopy.cpp b/src/plugins/exiv2/metacopy.cpp @@ -37,7 +37,6 @@ #include <fstream> #include <cassert> -#if 0 // ***************************************************************************** // Main int main(int argc, char* const argv[]) @@ -92,7 +91,6 @@ catch (Exiv2::AnyError& e) { return 10; } } -#endif int Params::option(int opt, const std::string& optarg, int optopt) { diff --git a/src/plugins/exiv2/olympusmn.cpp b/src/plugins/exiv2/olympusmn.cpp @@ -20,7 +20,7 @@ */ /* File: olympusmn.cpp - Version: $Rev: 581 $ + Version: $Rev: 600 $ Author(s): Will Stokes (wuz) <wstokes@gmail.com> Andreas Huggel (ahu) <ahuggel@gmx.net> History: 10-Mar-05, wuz: created @@ -29,7 +29,7 @@ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: olympusmn.cpp 581 2005-06-12 05:54:57Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: olympusmn.cpp 600 2005-07-09 10:38:09Z ahuggel $"); // ***************************************************************************** // included header files @@ -44,9 +44,6 @@ EXIV2_RCSID("@(#) $Id: olympusmn.cpp 581 2005-06-12 05:54:57Z ahuggel $"); #include <iomanip> #include <cassert> -// Define DEBUG_MAKERNOTE to output debug information to std::cerr -#undef DEBUG_MAKERNOTE - // ***************************************************************************** // class member definitions namespace Exiv2 { diff --git a/src/plugins/exiv2/panasonicmn.cpp b/src/plugins/exiv2/panasonicmn.cpp @@ -20,14 +20,14 @@ */ /* File: panasonicmn.cpp - Version: $Rev: 581 $ + Version: $Rev: 600 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> History: 11-Jun-04, ahu: created Credits: See header file */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: panasonicmn.cpp 581 2005-06-12 05:54:57Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: panasonicmn.cpp 600 2005-07-09 10:38:09Z ahuggel $"); // ***************************************************************************** // included header files @@ -42,9 +42,6 @@ EXIV2_RCSID("@(#) $Id: panasonicmn.cpp 581 2005-06-12 05:54:57Z ahuggel $"); #include <iomanip> #include <cassert> -// Define DEBUG_MAKERNOTE to output debug information to std::cerr -#undef DEBUG_MAKERNOTE - // ***************************************************************************** // class member definitions namespace Exiv2 { diff --git a/src/plugins/exiv2/sigmamn.cpp b/src/plugins/exiv2/sigmamn.cpp @@ -20,7 +20,7 @@ */ /* File: sigmamn.cpp - Version: $Rev: 569 $ + Version: $Rev: 600 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> History: 02-Apr-04, ahu: created Credits: Sigma and Foveon MakerNote implemented according to the specification @@ -29,7 +29,7 @@ */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: sigmamn.cpp 569 2005-05-28 05:48:43Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: sigmamn.cpp 600 2005-07-09 10:38:09Z ahuggel $"); // ***************************************************************************** // included header files @@ -44,9 +44,6 @@ EXIV2_RCSID("@(#) $Id: sigmamn.cpp 569 2005-05-28 05:48:43Z ahuggel $"); #include <iomanip> #include <cassert> -// Define DEBUG_MAKERNOTE to output debug information to std::cerr -#undef DEBUG_MAKERNOTE - // ***************************************************************************** // class member definitions namespace Exiv2 { diff --git a/src/plugins/exiv2/sonymn.cpp b/src/plugins/exiv2/sonymn.cpp @@ -20,13 +20,13 @@ */ /* File: sonymn.cpp - Version: $Rev: 569 $ + Version: $Rev: 600 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> History: 18-Apr-05, ahu: created */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: sonymn.cpp 569 2005-05-28 05:48:43Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: sonymn.cpp 600 2005-07-09 10:38:09Z ahuggel $"); // ***************************************************************************** // included header files @@ -41,9 +41,6 @@ EXIV2_RCSID("@(#) $Id: sonymn.cpp 569 2005-05-28 05:48:43Z ahuggel $"); #include <iomanip> #include <cassert> -// Define DEBUG_MAKERNOTE to output debug information to std::cerr -#undef DEBUG_MAKERNOTE - // ***************************************************************************** // class member definitions namespace Exiv2 { diff --git a/src/plugins/exiv2/tags.cpp b/src/plugins/exiv2/tags.cpp @@ -20,14 +20,14 @@ */ /* File: tags.cpp - Version: $Rev: 581 $ + Version: $Rev: 596 $ Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net> History: 15-Jan-04, ahu: created 21-Jan-05, ahu: added MakerNote TagInfo registry and related code */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Id: tags.cpp 581 2005-06-12 05:54:57Z ahuggel $"); +EXIV2_RCSID("@(#) $Id: tags.cpp 596 2005-06-26 11:04:27Z ahuggel $"); // ***************************************************************************** // included header files @@ -507,6 +507,7 @@ namespace Exiv2 { IfdId ifdId, const Value& value) { + if (value.count() == 0) return os; PrintFct fct = printValue; if (isExifIfd(ifdId)) { int idx = tagInfoIdx(tag, ifdId); @@ -734,8 +735,10 @@ namespace Exiv2 { std::ostream& printLong(std::ostream& os, const Value& value) { - return os << value.toLong(); - } + Rational r = value.toRational(); + if (r.second != 0) return os << static_cast<long>(r.first) / r.second; + return os << "(" << value << ")"; + } // printLong std::ostream& printFloat(std::ostream& os, const Value& value) {