[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:37 UTC 2017


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

The following commit has been merged in the master branch:
commit bc9d6852107a264540957e2b5929f8a855ad8670
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Jun 28 15:44:41 2009 +0000

    533: Applied patch 4_new_function_Photoshop_valid (Michael Ulbrich, Volker Grabsch)
---
 src/jpgimage.cpp | 25 +++++++++++++++++++++----
 src/jpgimage.hpp | 10 ++++++++++
 2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp
index 10ac5b7..d20930f 100644
--- a/src/jpgimage.cpp
+++ b/src/jpgimage.cpp
@@ -87,6 +87,23 @@ namespace Exiv2 {
     const char     Photoshop::bimId_[] = "8BIM";
     const uint16_t Photoshop::iptc_    = 0x0404;
 
+    bool Photoshop::valid(const byte* pPsData,
+                          long        sizePsData)
+    {
+        const byte *record = 0;
+        uint32_t sizeIptc = 0;
+        uint32_t sizeHdr = 0;
+        const byte* pCur = pPsData;
+        const byte* pEnd = pPsData + sizePsData;
+        int ret = 0;
+        while (pCur < pEnd
+               && 0 == (ret = Photoshop::locateIptcIrb(pCur, static_cast<long>(pEnd - pCur),
+                                                       &record, &sizeHdr, &sizeIptc))) {
+            pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
+        }
+        return ret >= 0;
+    }
+
     // Todo: Generalised from JpegBase::locateIptcData without really understanding
     //       the format (in particular the header). So it remains to be confirmed
     //       if this also makes sense for psTag != Photoshop::iptc
@@ -121,8 +138,8 @@ namespace Exiv2 {
             position += psSize;
             if (position + 4 > sizePsData) {
 #ifndef SUPPRESS_WARNINGS
-                std::cerr << "Error: "
-                          << "Invalid Photoshop IRB
";
+                std::cerr << "Warning: "
+                          << "Invalid or extended Photoshop IRB
";
 #endif
                 return -2;
             }
@@ -130,9 +147,9 @@ namespace Exiv2 {
             position += 4;
             if (dataSize > static_cast<uint32_t>(sizePsData - position)) {
 #ifndef SUPPRESS_WARNINGS
-                std::cerr << "Error: "
+                std::cerr << "Warning: "
                           << "Invalid Photoshop IRB data size "
-                          << dataSize << "
";
+                          << dataSize << " or extended Photoshop IRB
";
 #endif
                 return -2;
             }
diff --git a/src/jpgimage.hpp b/src/jpgimage.hpp
index ec043a1..e4a5496 100644
--- a/src/jpgimage.hpp
+++ b/src/jpgimage.hpp
@@ -64,6 +64,16 @@ namespace Exiv2 {
         static const uint16_t iptc_;    //!< %Photoshop IPTC marker
 
         /*!
+          @brief Validates all IRBs
+
+          @param pPsData        Existing IRB buffer
+          @param sizePsData     Size of the IRB buffer, may be 0
+          @return true  if all IRBs are valid;<BR>
+                  false otherwise
+        */
+        static bool valid(const byte* pPsData,
+                          long        sizePsData);
+        /*!
           @brief Locates the data for a %Photoshop tag in a %Photoshop formated memory
               buffer. Operates on raw data to simplify reuse.
           @param pPsData Pointer to buffer containing entire payload of

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list