[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:25 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=e57c3e5
The following commit has been merged in the master branch:
commit e57c3e5e8acbf3efdf105a0e3fbd54dcd535447f
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sat Mar 21 10:03:38 2009 +0000
#623: Removed class TiffPrinter and tiffparse.cpp.
---
src/tiffparse.cpp | 68 ---------------------------
src/tiffvisitor.cpp | 120 ------------------------------------------------
src/tiffvisitor_int.hpp | 65 --------------------------
3 files changed, 253 deletions(-)
diff --git a/src/tiffparse.cpp b/src/tiffparse.cpp
deleted file mode 100644
index e24f118..0000000
--- a/src/tiffparse.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-// ***************************************************************** -*- C++ -*-
-// tiffparse.cpp, $Rev$
-// Print the structure of a TIFF file
-
-#include <exiv2/tiffparser.hpp>
-#include <exiv2/tiffcomposite.hpp>
-#include <exiv2/tiffvisitor.hpp>
-#include <exiv2/tiffimage.hpp>
-#include <exiv2/futils.hpp>
-
-#include <iostream>
-
-using namespace Exiv2;
-
-int main(int argc, char* const argv[])
-try {
- if (argc != 2) {
- std::cout << "Usage: " << argv[0] << " file
";
- std::cout << "Print the structure of a TIFF file
";
- return 1;
- }
-
- FileIo io(argv[1]);
- if(io.open() != 0) {
- throw Error(9, io.path(), strError());
- }
- IoCloser closer(io);
-
- // Ensure that this is the correct image type
- if (!isTiffType(io, false)) {
- if (io.error() || io.eof()) throw Error(14);
- throw Error(3, "TIFF");
- }
-
- // Read the image into a memory buffer
- long len = io.size();
- DataBuf buf(len);
- io.read(buf.pData_, len);
- if (io.error() || io.eof()) throw Error(14);
-
- TiffHeader tiffHeader;
- if (!tiffHeader.read(buf.pData_, buf.size_)) throw Error(3, "TIFF");
-
- TiffComponent::AutoPtr rootDir = TiffCreator::create(Tag::root, Group::none);
- if (0 == rootDir.get()) {
- throw Error(1, "No root element defined in TIFF structure");
- }
- rootDir->setStart(buf.pData_ + tiffHeader.offset());
-
- TiffRwState::AutoPtr state(new TiffRwState(tiffHeader.byteOrder(), 0));
-
- TiffReader reader(buf.pData_,
- buf.size_,
- rootDir.get(),
- state);
-
- rootDir->accept(reader);
-
- tiffHeader.print(std::cerr);
- TiffPrinter tiffPrinter(std::cerr);
- rootDir->accept(tiffPrinter);
-
- return 0;
-}
-catch (AnyError& e) {
- std::cerr << e << "
";
- return -1;
-}
diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp
index 7aadfbf..92296c3 100644
--- a/src/tiffvisitor.cpp
+++ b/src/tiffvisitor.cpp
@@ -912,126 +912,6 @@ namespace Exiv2 {
}
} // TiffEncoder::add
- const std::string TiffPrinter::indent_(" ");
-
- void TiffPrinter::incIndent()
- {
- prefix_ += indent_;
- } // TiffPrinter::incIndent
-
- void TiffPrinter::decIndent()
- {
- if (prefix_.length() >= indent_.length()) {
- prefix_.erase(prefix_.length() - indent_.length(), indent_.length());
- }
- } // TiffPrinter::decIndent
-
- void TiffPrinter::visitEntry(TiffEntry* object)
- {
- printTiffEntry(object, prefix());
- } // TiffPrinter::visitEntry
-
- void TiffPrinter::visitDataEntry(TiffDataEntry* object)
- {
- printTiffEntry(object, prefix());
- if (object->pValue()) {
- os_ << prefix() << _("Data area") << " "
- << object->pValue()->sizeDataArea()
- << " " << _("bytes.
");
- }
- } // TiffPrinter::visitDataEntry
-
- void TiffPrinter::visitImageEntry(TiffImageEntry* object)
- {
- printTiffEntry(object, prefix());
- } // TiffPrinter::visitImageEntry
-
- void TiffPrinter::visitSizeEntry(TiffSizeEntry* object)
- {
- printTiffEntry(object, prefix());
- }
-
- void TiffPrinter::visitDirectory(TiffDirectory* object)
- {
- assert(object != 0);
- os_ << prefix() << tiffGroupName(object->group())
- << " " << _("directory with") << " "
- // cast to make MSVC happy
- << std::dec << static_cast<unsigned int>(object->components_.size());
- if (object->components_.size() == 1) os_ << " " << _("entry:
");
- else os_ << " " << _("entries:
");
- incIndent();
-
- } // TiffPrinter::visitDirectory
-
- void TiffPrinter::visitDirectoryNext(TiffDirectory* object)
- {
- decIndent();
- if (object->hasNext()) {
- if (object->pNext_) os_ << prefix() << _("Next directory:
");
- else os_ << prefix() << _("No next directory
");
- }
- } // TiffPrinter::visitDirectoryNext
-
- void TiffPrinter::visitDirectoryEnd(TiffDirectory* /*object*/)
- {
- // Nothing to do
- } // TiffPrinter::visitDirectoryEnd
-
- void TiffPrinter::visitSubIfd(TiffSubIfd* object)
- {
- os_ << prefix() << _("Sub-IFD") << " ";
- printTiffEntry(object);
- } // TiffPrinter::visitSubIfd
-
- void TiffPrinter::visitMnEntry(TiffMnEntry* object)
- {
- if (!object->mn_) printTiffEntry(object, prefix());
- else os_ << prefix() << _("Makernote") << " ";
- } // TiffPrinter::visitMnEntry
-
- void TiffPrinter::visitIfdMakernote(TiffIfdMakernote* /*object*/)
- {
- // Nothing to do
- } // TiffPrinter::visitIfdMakernote
-
- void TiffPrinter::printTiffEntry(TiffEntryBase* object,
- const std::string& px) const
- {
- assert(object != 0);
-
- os_ << px << tiffGroupName(object->group())
- << " " << _("tag") << " 0x" << std::setw(4) << std::setfill('0')
- << std::hex << std::right << object->tag()
- << ", " << _("type") << " 0x" << std::hex << object->tiffType()
- << ", " << std::dec << object->count() << " "<< _("component");
- if (object->count() > 1) os_ << "s";
- os_ << " in " << object->size() << " " << _("bytes");
- if (object->size() > 4) os_ << ", " << _("offset") << " " << object->offset();
- os_ << "
";
- const Value* vp = object->pValue();
- if (vp && vp->count() < 100) os_ << prefix() << *vp;
- else os_ << prefix() << "...";
- os_ << "
";
-
- } // TiffPrinter::printTiffEntry
-
- void TiffPrinter::visitArrayEntry(TiffArrayEntry* object)
- {
- os_ << prefix() << _("Array Entry") << " " << tiffGroupName(object->group())
- << " " << _("tag") << " 0x" << std::setw(4) << std::setfill('0')
- << std::hex << std::right << object->tag() << " " << _("with")
- << " " << std::dec << object->count() << " ";
- if (object->count() > 1) os_ << _("elements");
- else os_ << _("element");
- os_ << "
";
- } // TiffPrinter::visitArrayEntry
-
- void TiffPrinter::visitArrayElement(TiffArrayElement* object)
- {
- printTiffEntry(object, prefix());
- } // TiffPrinter::visitArrayElement
-
TiffReader::TiffReader(const byte* pData,
uint32_t size,
TiffComponent* pRoot,
diff --git a/src/tiffvisitor_int.hpp b/src/tiffvisitor_int.hpp
index 6a452b8..e718d3f 100644
--- a/src/tiffvisitor_int.hpp
+++ b/src/tiffvisitor_int.hpp
@@ -631,71 +631,6 @@ namespace Exiv2 {
}; // class TiffReader
- /*!
- @brief TIFF composite visitor to print the TIFF structure to an output
- stream.
- */
- class TiffPrinter : public TiffVisitor {
- public:
- //! @name Creators
- //@{
- //! Constructor, takes an output stream to write to.
- TiffPrinter(std::ostream& os, const std::string& prefix ="")
- : os_(os), prefix_(prefix) {}
- //! Virtual destructor
- virtual ~TiffPrinter() {}
- //@}
-
- //! @name Manipulators
- //@{
- //! Print a TIFF entry.
- virtual void visitEntry(TiffEntry* object);
- //! Print a TIFF data entry.
- virtual void visitDataEntry(TiffDataEntry* object);
- //! Print a TIFF image entry.
- virtual void visitImageEntry(TiffImageEntry* object);
- //! Print a TIFF size entry.
- virtual void visitSizeEntry(TiffSizeEntry* object);
- //! Print a TIFF directory
- virtual void visitDirectory(TiffDirectory* object);
- //! Print header before next directory
- virtual void visitDirectoryNext(TiffDirectory* object);
- //! Cleanup before leaving this directory
- virtual void visitDirectoryEnd(TiffDirectory* object);
- //! Print a TIFF sub-IFD
- virtual void visitSubIfd(TiffSubIfd* object);
- //! Print a TIFF makernote
- virtual void visitMnEntry(TiffMnEntry* object);
- //! Print an IFD makernote
- virtual void visitIfdMakernote(TiffIfdMakernote* object);
- //! Print an array entry component
- virtual void visitArrayEntry(TiffArrayEntry* object);
- //! Print an array element
- virtual void visitArrayElement(TiffArrayElement* object);
-
- //! Increment the indent by one level
- void incIndent();
- //! Decrement the indent by one level
- void decIndent();
- //@}
-
- //! @name Accessors
- //@{
- //! Print a standard TIFF entry.
- void printTiffEntry(TiffEntryBase* object,
- const std::string& prefix ="") const;
- //! Return the current prefix
- std::string prefix() const { return prefix_; }
- //@}
-
- private:
- // DATA
- std::ostream& os_; //!< Output stream to write to
- std::string prefix_; //!< Current prefix
-
- static const std::string indent_; //!< Indent for one level
- }; // class TiffPrinter
-
}} // namespace Internal, Exiv2
#endif // #ifndef TIFFVISITOR_INT_HPP_
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list