[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:37:21 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=bce4645

The following commit has been merged in the master branch:
commit bce464516543db71249e7424cfb61c907d7c2062
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Mon Dec 26 12:59:59 2005 +0000

    Added a parser layer to the Crw image handling code. No functional change.
---
 src/crwimage.cpp | 30 +++++++++++++++++++-----------
 src/crwimage.hpp | 25 ++++++++++++++++++++++---
 2 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/src/crwimage.cpp b/src/crwimage.cpp
index 035f283..f066be2 100644
--- a/src/crwimage.cpp
+++ b/src/crwimage.cpp
@@ -150,19 +150,12 @@ namespace Exiv2 {
         clearMetadata();
 
         // Read the image into a memory buffer
-        long imageSize = io_->size();
-        DataBuf image(imageSize);
-        io_->read(image.pData_, imageSize);
+        long len = io_->size();
+        DataBuf buf(len);
+        io_->read(buf.pData_, len);
         if (io_->error() || io_->eof()) throw Error(14);
 
-        // Parse the image
-        RawMetadata::AutoPtr parseTree(new CiffHeader);
-        parseTree->read(image.pData_, image.size_, 0, invalidByteOrder);
-#ifdef DEBUG
-        parseTree->print(std::cerr, invalidByteOrder);
-#endif
-        parseTree->extract(*this, invalidByteOrder);
-
+        CrwParser::decode(this, buf.pData_, buf.size_);
     } // CrwImage::readMetadata
 
     void CrwImage::writeMetadata()
@@ -175,6 +168,21 @@ namespace Exiv2 {
         return isCrwType(iIo, advance);
     }
 
+    void CrwParser::decode(CrwImage* crwImage, const byte* buf, uint32_t len)
+    {
+        assert(crwImage != 0);
+        assert(buf != 0);
+
+        // Parse the image
+        RawMetadata::AutoPtr parseTree(new CiffHeader);
+        parseTree->read(buf, len, 0, invalidByteOrder);
+#ifdef DEBUG
+        parseTree->print(std::cerr, invalidByteOrder);
+#endif
+        parseTree->extract(*crwImage, invalidByteOrder);
+
+    } // CrwParser::decode
+
     void CiffComponent::read(const byte* buf,
                              uint32_t len,
                              uint32_t start,
diff --git a/src/crwimage.hpp b/src/crwimage.hpp
index 4807873..2e26b88 100644
--- a/src/crwimage.hpp
+++ b/src/crwimage.hpp
@@ -258,6 +258,28 @@ namespace Exiv2 {
     }; // class RawMetadata
 
     /*!
+      Stateless parser class for Canon Crw images (Ciff format).
+    */
+    class CrwParser {
+    public:
+        /*!
+          @brief Decode metadata from a Canon Crw image in data buffer \em buf of length
+                 \em len into \em crwImage.
+
+          This is the entry point to access image data in Ciff format. The parser uses 
+          classes CiffHeader, CiffEntry, CiffDirectory.
+
+          @param crwImage %Exiv2 Crw image to hold the metadata read from the buffer.
+          @param buf      Pointer to the data buffer. Must point to the data of a Crw 
+                          image; no checks are performed.
+          @param len      Length of the data buffer.
+        */
+        static void decode(CrwImage* crwImage, const byte* buf, uint32_t len);
+        //! Todo: implement me!
+        static void encode();
+    };
+
+    /*!
       @brief Interface class for components of the CIFF directory hierarchy of
              a Crw (Canon Raw data) image. Both CIFF directories as well as
              entries implement this interface.
@@ -277,9 +299,6 @@ namespace Exiv2 {
         // Default assignment operator is fine
 
         // See base class comment
-        virtual void add(RawMetadata::AutoPtr component) =0;
-
-        // See base class comment
         virtual void read(const byte* buf,
                           uint32_t len,
                           uint32_t start,

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list