From 4e7f2ee7d97a8bf0cd0c750a43d4fd0f3bd0d20e Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Wed, 26 Apr 2006 04:19:02 +0000 Subject: [PATCH] New TIFF parser: Added Panasonic, Sigma and Sony makernotes --- src/Makefile | 3 + src/makernote2.hpp | 7 ++- src/mnreg.cpp | 15 +++-- src/panasonicmn2.cpp | 103 ++++++++++++++++++++++++++++++++++ src/panasonicmn2.hpp | 126 +++++++++++++++++++++++++++++++++++++++++ src/sigmamn2.cpp | 103 ++++++++++++++++++++++++++++++++++ src/sigmamn2.hpp | 127 ++++++++++++++++++++++++++++++++++++++++++ src/sonymn2.cpp | 103 ++++++++++++++++++++++++++++++++++ src/sonymn2.hpp | 126 +++++++++++++++++++++++++++++++++++++++++ src/tiffcomposite.cpp | 4 ++ src/tiffparser.cpp | 1 + src/tiffvisitor.cpp | 5 +- 12 files changed, 716 insertions(+), 7 deletions(-) create mode 100644 src/panasonicmn2.cpp create mode 100644 src/panasonicmn2.hpp create mode 100644 src/sigmamn2.cpp create mode 100644 src/sigmamn2.hpp create mode 100644 src/sonymn2.cpp create mode 100644 src/sonymn2.hpp diff --git a/src/Makefile b/src/Makefile index b49e5453..6ded735c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -77,8 +77,11 @@ CCSRC = basicio.cpp \ olympusmn.cpp \ olympusmn2.cpp \ panasonicmn.cpp \ + panasonicmn2.cpp \ sigmamn.cpp \ + sigmamn2.cpp \ sonymn.cpp \ + sonymn2.cpp \ tags.cpp \ tiffcomposite.cpp \ tiffimage.cpp \ diff --git a/src/makernote2.hpp b/src/makernote2.hpp index 578fc645..94a5dc4c 100644 --- a/src/makernote2.hpp +++ b/src/makernote2.hpp @@ -145,8 +145,11 @@ namespace Exiv2 { //! @name Creators //@{ //! Default constructor - TiffIfdMakernote(uint16_t tag, uint16_t group, uint16_t mnGroup) - : TiffComponent(tag, group), ifd_(tag, mnGroup) {} + TiffIfdMakernote(uint16_t tag, + uint16_t group, + uint16_t mnGroup, + bool hasNext =true) + : TiffComponent(tag, group), ifd_(tag, mnGroup, hasNext) {} //! Virtual destructor virtual ~TiffIfdMakernote() =0; //@} diff --git a/src/mnreg.cpp b/src/mnreg.cpp index 6c315b5f..dcf04f97 100644 --- a/src/mnreg.cpp +++ b/src/mnreg.cpp @@ -36,6 +36,9 @@ EXIV2_RCSID("@(#) $Id$"); #include "fujimn2.hpp" #include "nikonmn2.hpp" #include "olympusmn2.hpp" +#include "panasonicmn2.hpp" +#include "sigmamn2.hpp" +#include "sonymn2.hpp" // + standard includes @@ -44,10 +47,14 @@ EXIV2_RCSID("@(#) $Id$"); namespace Exiv2 { const TiffMnRegistry TiffMnCreator::registry_[] = { - { "Canon", newCanonMn, Group::canonmn }, - { "FUJIFILM", newFujiMn, Group::fujimn }, - { "NIKON", newNikonMn, Group::nikonmn }, - { "OLYMPUS", newOlympusMn, Group::olympmn } + { "Canon", newCanonMn, Group::canonmn }, + { "FOVEON", newSigmaMn, Group::sigmamn }, + { "FUJIFILM", newFujiMn, Group::fujimn }, + { "NIKON", newNikonMn, Group::nikonmn }, + { "OLYMPUS", newOlympusMn, Group::olympmn }, + { "Panasonic", newPanasonicMn, Group::panamn }, + { "SIGMA", newSigmaMn, Group::sigmamn }, + { "SONY", newSonyMn, Group::sonymn } }; diff --git a/src/panasonicmn2.cpp b/src/panasonicmn2.cpp new file mode 100644 index 00000000..0514af21 --- /dev/null +++ b/src/panasonicmn2.cpp @@ -0,0 +1,103 @@ +// ***************************************************************** -*- C++ -*- +/* + * Copyright (C) 2006 Andreas Huggel + * + * This program is part of the Exiv2 distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA. + */ +/* + File: panasonicmn2.cpp + Version: $Rev$ + Author(s): Andreas Huggel (ahu) + History: 18-Apr-06, ahu: created + */ +// ***************************************************************************** +#include "rcsid.hpp" +EXIV2_RCSID("@(#) $Id$"); + +// Define DEBUG to output debug information to std::cerr, e.g, by calling make +// like this: make DEFS=-DDEBUG makernote2.o +//#define DEBUG + +// ***************************************************************************** +// included header files +#ifdef _MSC_VER +# include "exv_msvc.h" +#else +# include "exv_conf.h" +#endif + +#include "panasonicmn2.hpp" +#include "tiffcomposite.hpp" +#include "types.hpp" + +// + standard includes + +// ***************************************************************************** +// class member definitions +namespace Exiv2 { + + const byte PanasonicMnHeader::signature_[] = { + 'P', 'a', 'n', 'a', 's', 'o', 'n', 'i', 'c', 0x00, 0x00, 0x00 + }; + const uint32_t PanasonicMnHeader::size_ = 12; + + PanasonicMnHeader::PanasonicMnHeader() + { + read(signature_, size_, invalidByteOrder); + } + + bool PanasonicMnHeader::read(const byte* pData, + uint32_t size, + ByteOrder /*byteOrder*/) + { + assert (pData != 0); + + if (size < size_) return false; + if (0 != memcmp(pData, signature_, 9)) return false; + buf_.alloc(size_); + memcpy(buf_.pData_, pData, buf_.size_); + start_ = size_; + return true; + + } // PanasonicMnHeader::read + + bool TiffPanasonicMn::doReadHeader(const byte* pData, + uint32_t size, + ByteOrder byteOrder) + { + return header_.read(pData, size, byteOrder); + } + + uint32_t TiffPanasonicMn::doIfdOffset() const + { + return header_.ifdOffset(); + } + + // ************************************************************************* + // free functions + + TiffComponent* newPanasonicMn(uint16_t tag, + uint16_t group, + uint16_t mnGroup, + const byte* /*pData*/, + uint32_t /*size*/, + ByteOrder /*byteOrder*/) + { + return new TiffPanasonicMn(tag, group, mnGroup); + } + +} // namespace Exiv2 diff --git a/src/panasonicmn2.hpp b/src/panasonicmn2.hpp new file mode 100644 index 00000000..d6676cf4 --- /dev/null +++ b/src/panasonicmn2.hpp @@ -0,0 +1,126 @@ +// ***************************************************************** -*- C++ -*- +/* + * Copyright (C) 2006 Andreas Huggel + * + * This program is part of the Exiv2 distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA. + */ +/*! + @file panasonicmn2.hpp + @brief TIFF Panasonic makernote + @version $Rev$ + @author Andreas Huggel (ahu) + ahuggel@gmx.net + @date 18-Apr-06, ahu: created + */ +#ifndef PANASONICMN2_HPP_ +#define PANASONICMN2_HPP_ + +// ***************************************************************************** +// included header files +#include "makernote2.hpp" +#include "tiffcomposite.hpp" +#include "types.hpp" + +// + standard includes + +// ***************************************************************************** +// namespace extensions +namespace Exiv2 { + +// ***************************************************************************** +// class definitions + + namespace Group { + const uint16_t panamn = 267; //!< Panasonic makernote + } + + //! Header of a Panasonic Makernote + class PanasonicMnHeader : public MnHeader { + public: + //! @name Creators + //@{ + //! Default constructor + PanasonicMnHeader(); + //! Virtual destructor. + virtual ~PanasonicMnHeader() {} + //@} + //! @name Manipulators + //@{ + virtual bool read(const byte* pData, + uint32_t size, + ByteOrder byteOrder); + //@} + //! @name Accessors + //@{ + virtual uint32_t size() const { return size_; } + virtual uint32_t ifdOffset() const { return start_; } + //@} + + private: + DataBuf buf_; //!< Raw header data + uint32_t start_; //!< Start of the mn IFD rel. to mn start + static const byte signature_[]; //!< Panasonic makernote header signature + static const uint32_t size_; //!< Size of the signature + + }; // class PanasonicMnHeader + + /*! + @brief Panasonic Makernote + */ + class TiffPanasonicMn : public TiffIfdMakernote { + public: + //! @name Creators + //@{ + //! Default constructor. + TiffPanasonicMn(uint16_t tag, uint16_t group, uint16_t mnGroup) + : TiffIfdMakernote(tag, group, mnGroup, false) {} + //! Virtual destructor + virtual ~TiffPanasonicMn() {} + //@} + private: + //! @name Manipulators + //@{ + virtual bool doReadHeader(const byte* pData, + uint32_t size, + ByteOrder byteOrder); + //@} + + //! @name Accessors + //@{ + virtual uint32_t doIfdOffset() const; + //@} + + private: + // DATA + PanasonicMnHeader header_; //!< Makernote header + + }; // class TiffPanasonicMn + +// ***************************************************************************** +// template, inline and free functions + + //! Function to create a Panasonic makernote + TiffComponent* newPanasonicMn(uint16_t tag, + uint16_t group, + uint16_t mnGroup, + const byte* pData, + uint32_t size, + ByteOrder byteOrder); + +} // namespace Exiv2 + +#endif // #ifndef PANASONICMN2_HPP_ diff --git a/src/sigmamn2.cpp b/src/sigmamn2.cpp new file mode 100644 index 00000000..5545f4cf --- /dev/null +++ b/src/sigmamn2.cpp @@ -0,0 +1,103 @@ +// ***************************************************************** -*- C++ -*- +/* + * Copyright (C) 2006 Andreas Huggel + * + * This program is part of the Exiv2 distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA. + */ +/* + File: sigmamn2.cpp + Version: $Rev$ + Author(s): Andreas Huggel (ahu) + History: 18-Apr-06, ahu: created + */ +// ***************************************************************************** +#include "rcsid.hpp" +EXIV2_RCSID("@(#) $Id$"); + +// ***************************************************************************** +// included header files +#ifdef _MSC_VER +# include "exv_msvc.h" +#else +# include "exv_conf.h" +#endif + +#include "sigmamn2.hpp" +#include "tiffcomposite.hpp" +#include "types.hpp" + +// + standard includes + +// ***************************************************************************** +// class member definitions +namespace Exiv2 { + + const byte SigmaMnHeader::signature1_[] = { + 'S', 'I', 'G', 'M', 'A', '\0', '\0', '\0', 0x01, 0x00 + }; + const byte SigmaMnHeader::signature2_[] = { + 'F', 'O', 'V', 'E', 'O', 'N', '\0', '\0', 0x01, 0x00 + }; + const uint32_t SigmaMnHeader::size_ = 10; + + SigmaMnHeader::SigmaMnHeader() + { + read(signature1_, size_, invalidByteOrder); + } + + bool SigmaMnHeader::read(const byte* pData, + uint32_t size, + ByteOrder /*byteOrder*/) + { + assert (pData != 0); + + if (size < size_) return false; + if ( 0 != memcmp(pData, signature1_, 8) + && 0 != memcmp(pData, signature2_, 8)) return false; + buf_.alloc(size_); + memcpy(buf_.pData_, pData, buf_.size_); + start_ = size_; + return true; + + } // SigmaMnHeader::read + + bool TiffSigmaMn::doReadHeader(const byte* pData, + uint32_t size, + ByteOrder byteOrder) + { + return header_.read(pData, size, byteOrder); + } + + uint32_t TiffSigmaMn::doIfdOffset() const + { + return header_.ifdOffset(); + } + + // ************************************************************************* + // free functions + + TiffComponent* newSigmaMn(uint16_t tag, + uint16_t group, + uint16_t mnGroup, + const byte* /*pData*/, + uint32_t /*size*/, + ByteOrder /*byteOrder*/) + { + return new TiffSigmaMn(tag, group, mnGroup); + } + +} // namespace Exiv2 diff --git a/src/sigmamn2.hpp b/src/sigmamn2.hpp new file mode 100644 index 00000000..4359536f --- /dev/null +++ b/src/sigmamn2.hpp @@ -0,0 +1,127 @@ +// ***************************************************************** -*- C++ -*- +/* + * Copyright (C) 2006 Andreas Huggel + * + * This program is part of the Exiv2 distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA. + */ +/*! + @file sigmamn2.hpp + @brief TIFF Sigma makernote + @version $Rev$ + @author Andreas Huggel (ahu) + ahuggel@gmx.net + @date 18-Apr-06, ahu: created + */ +#ifndef SIGMAMN2_HPP_ +#define SIGMAMN2_HPP_ + +// ***************************************************************************** +// included header files +#include "makernote2.hpp" +#include "tiffcomposite.hpp" +#include "types.hpp" + +// + standard includes + +// ***************************************************************************** +// namespace extensions +namespace Exiv2 { + +// ***************************************************************************** +// class definitions + + namespace Group { + const uint16_t sigmamn = 268; //!< Sigma makernote + } + + //! Header of a Sigma Makernote + class SigmaMnHeader : public MnHeader { + public: + //! @name Creators + //@{ + //! Default constructor + SigmaMnHeader(); + //! Virtual destructor. + virtual ~SigmaMnHeader() {} + //@} + //! @name Manipulators + //@{ + virtual bool read(const byte* pData, + uint32_t size, + ByteOrder byteOrder); + //@} + //! @name Accessors + //@{ + virtual uint32_t size() const { return size_; } + virtual uint32_t ifdOffset() const { return start_; } + //@} + + private: + DataBuf buf_; //!< Raw header data + uint32_t start_; //!< Start of the mn IFD rel. to mn start + static const byte signature1_[]; //!< Sigma makernote header signature 1 + static const byte signature2_[]; //!< Sigma makernote header signature 2 + static const uint32_t size_; //!< Size of the signature + + }; // class SigmaMnHeader + + /*! + @brief Sigma Makernote + */ + class TiffSigmaMn : public TiffIfdMakernote { + public: + //! @name Creators + //@{ + //! Default constructor. + TiffSigmaMn(uint16_t tag, uint16_t group, uint16_t mnGroup) + : TiffIfdMakernote(tag, group, mnGroup) {} + //! Virtual destructor + virtual ~TiffSigmaMn() {} + //@} + private: + //! @name Manipulators + //@{ + virtual bool doReadHeader(const byte* pData, + uint32_t size, + ByteOrder byteOrder); + //@} + + //! @name Accessors + //@{ + virtual uint32_t doIfdOffset() const; + //@} + + private: + // DATA + SigmaMnHeader header_; //!< Makernote header + + }; // class TiffSigmaMn + +// ***************************************************************************** +// template, inline and free functions + + //! Function to create a Sigma makernote + TiffComponent* newSigmaMn(uint16_t tag, + uint16_t group, + uint16_t mnGroup, + const byte* pData, + uint32_t size, + ByteOrder byteOrder); + +} // namespace Exiv2 + +#endif // #ifndef SIGMAMN2_HPP_ diff --git a/src/sonymn2.cpp b/src/sonymn2.cpp new file mode 100644 index 00000000..4f7f08fa --- /dev/null +++ b/src/sonymn2.cpp @@ -0,0 +1,103 @@ +// ***************************************************************** -*- C++ -*- +/* + * Copyright (C) 2006 Andreas Huggel + * + * This program is part of the Exiv2 distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA. + */ +/* + File: sonymn2.cpp + Version: $Rev$ + Author(s): Andreas Huggel (ahu) + History: 18-Apr-06, ahu: created + */ +// ***************************************************************************** +#include "rcsid.hpp" +EXIV2_RCSID("@(#) $Id$"); + +// Define DEBUG to output debug information to std::cerr, e.g, by calling make +// like this: make DEFS=-DDEBUG makernote2.o +//#define DEBUG + +// ***************************************************************************** +// included header files +#ifdef _MSC_VER +# include "exv_msvc.h" +#else +# include "exv_conf.h" +#endif + +#include "sonymn2.hpp" +#include "tiffcomposite.hpp" +#include "types.hpp" + +// + standard includes + +// ***************************************************************************** +// class member definitions +namespace Exiv2 { + + const byte SonyMnHeader::signature_[] = { + 'S', 'O', 'N', 'Y', ' ', 'D', 'S', 'C', ' ', '\0', '\0', '\0' + }; + const uint32_t SonyMnHeader::size_ = 12; + + SonyMnHeader::SonyMnHeader() + { + read(signature_, size_, invalidByteOrder); + } + + bool SonyMnHeader::read(const byte* pData, + uint32_t size, + ByteOrder /*byteOrder*/) + { + assert (pData != 0); + + if (size < size_) return false; + if (0 != memcmp(pData, signature_, size_)) return false; + buf_.alloc(size_); + memcpy(buf_.pData_, pData, buf_.size_); + start_ = size_; + return true; + + } // SonyMnHeader::read + + bool TiffSonyMn::doReadHeader(const byte* pData, + uint32_t size, + ByteOrder byteOrder) + { + return header_.read(pData, size, byteOrder); + } + + uint32_t TiffSonyMn::doIfdOffset() const + { + return header_.ifdOffset(); + } + + // ************************************************************************* + // free functions + + TiffComponent* newSonyMn(uint16_t tag, + uint16_t group, + uint16_t mnGroup, + const byte* /*pData*/, + uint32_t /*size*/, + ByteOrder /*byteOrder*/) + { + return new TiffSonyMn(tag, group, mnGroup); + } + +} // namespace Exiv2 diff --git a/src/sonymn2.hpp b/src/sonymn2.hpp new file mode 100644 index 00000000..6987ad27 --- /dev/null +++ b/src/sonymn2.hpp @@ -0,0 +1,126 @@ +// ***************************************************************** -*- C++ -*- +/* + * Copyright (C) 2006 Andreas Huggel + * + * This program is part of the Exiv2 distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA. + */ +/*! + @file sonymn2.hpp + @brief TIFF Sony makernote + @version $Rev$ + @author Andreas Huggel (ahu) + ahuggel@gmx.net + @date 18-Apr-06, ahu: created + */ +#ifndef SONYMN2_HPP_ +#define SONYMN2_HPP_ + +// ***************************************************************************** +// included header files +#include "makernote2.hpp" +#include "tiffcomposite.hpp" +#include "types.hpp" + +// + standard includes + +// ***************************************************************************** +// namespace extensions +namespace Exiv2 { + +// ***************************************************************************** +// class definitions + + namespace Group { + const uint16_t sonymn = 269; //!< Sony makernote + } + + //! Header of a Sony Makernote + class SonyMnHeader : public MnHeader { + public: + //! @name Creators + //@{ + //! Default constructor + SonyMnHeader(); + //! Virtual destructor. + virtual ~SonyMnHeader() {} + //@} + //! @name Manipulators + //@{ + virtual bool read(const byte* pData, + uint32_t size, + ByteOrder byteOrder); + //@} + //! @name Accessors + //@{ + virtual uint32_t size() const { return size_; } + virtual uint32_t ifdOffset() const { return start_; } + //@} + + private: + DataBuf buf_; //!< Raw header data + uint32_t start_; //!< Start of the mn IFD rel. to mn start + static const byte signature_[]; //!< Sony makernote header signature + static const uint32_t size_; //!< Size of the signature + + }; // class SonyMnHeader + + /*! + @brief Sony Makernote + */ + class TiffSonyMn : public TiffIfdMakernote { + public: + //! @name Creators + //@{ + //! Default constructor. + TiffSonyMn(uint16_t tag, uint16_t group, uint16_t mnGroup) + : TiffIfdMakernote(tag, group, mnGroup) {} + //! Virtual destructor + virtual ~TiffSonyMn() {} + //@} + private: + //! @name Manipulators + //@{ + virtual bool doReadHeader(const byte* pData, + uint32_t size, + ByteOrder byteOrder); + //@} + + //! @name Accessors + //@{ + virtual uint32_t doIfdOffset() const; + //@} + + private: + // DATA + SonyMnHeader header_; //!< Makernote header + + }; // class TiffSonyMn + +// ***************************************************************************** +// template, inline and free functions + + //! Function to create a Sony makernote + TiffComponent* newSonyMn(uint16_t tag, + uint16_t group, + uint16_t mnGroup, + const byte* pData, + uint32_t size, + ByteOrder byteOrder); + +} // namespace Exiv2 + +#endif // #ifndef SONYMN2_HPP_ diff --git a/src/tiffcomposite.cpp b/src/tiffcomposite.cpp index 2dc1cc53..9e7a1138 100644 --- a/src/tiffcomposite.cpp +++ b/src/tiffcomposite.cpp @@ -105,9 +105,13 @@ namespace Exiv2 { case 260: group = "CanonCs1"; break; case 261: group = "CanonCs2"; break; case 262: group = "CanonCf"; break; + // 263 not needed (canonmn) case 264: group = "Nikon1"; break; case 265: group = "Nikon2"; break; case 266: group = "Nikon3"; break; + case 267: group = "Panasonic"; break; + case 268: group = "Sigma"; break; + case 269: group = "Sony"; break; default: group = "Unknown"; break; } return group; diff --git a/src/tiffparser.cpp b/src/tiffparser.cpp index e3fe9c74..d384fda5 100644 --- a/src/tiffparser.cpp +++ b/src/tiffparser.cpp @@ -59,6 +59,7 @@ EXIV2_RCSID("@(#) $Id$"); + TiffComponent: should it have end() and setEnd() or pData and size? + Can NewTiffCompFct and TiffCompFactoryFct be combined? + Create function is repeated when actually only the table changes. Fix it. + + Is it easier (for writing) to combine all creation tables into one? + CR2 Makernotes don't seem to have a next pointer but Canon Jpeg Makernotes do. What a mess. (That'll become an issue when it comes to writing to CR2) diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp index 4aa5232f..b79a47e8 100644 --- a/src/tiffvisitor.cpp +++ b/src/tiffvisitor.cpp @@ -568,7 +568,10 @@ namespace Exiv2 { static_cast(pLast_ - object->start()), byteOrder())) { #ifndef SUPPRESS_WARNINGS - std::cerr << "Error: Failed to read IFD Makernote header.\n"; + std::cerr << "Error: Failed to read " + << object->ifd_.groupName() + << " (" << object->ifd_.group() + << ") IFD Makernote header.\n"; #endif return; // todo: signal error to parent, delete object }