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


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

The following commit has been merged in the master branch:
commit f7b11097388229cfd41a232056acb0499142357d
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Tue Jun 16 13:30:36 2009 +0000

    #638: Aligned IPTC decoding with the new encoding, but kept it backward compatible for broken images.
---
 src/pngchunk.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 47 insertions(+), 8 deletions(-)

diff --git a/src/pngchunk.cpp b/src/pngchunk.cpp
index 36fc8b1..4ae6b63 100644
--- a/src/pngchunk.cpp
+++ b/src/pngchunk.cpp
@@ -46,6 +46,7 @@ extern "C" {
 
 #include "pngchunk_int.hpp"
 #include "tiffimage.hpp"
+#include "jpgimage.hpp"
 #include "exif.hpp"
 #include "iptc.hpp"
 #include "image.hpp"
@@ -281,14 +282,52 @@ namespace Exiv2 {
 
         // We look if an ImageMagick IPTC raw profile exist.
 
-        if ( memcmp("Raw profile type iptc", key, 21) == 0 &&
-             pImage->iptcData().empty())
-        {
-            DataBuf iptcData = readRawProfile(arr);
-            long length      = iptcData.size_;
-
-            if (length > 0)
-                IptcParser::decode(pImage->iptcData(), iptcData.pData_, length);
+        if (   memcmp("Raw profile type iptc", key, 21) == 0
+            && pImage->iptcData().empty()) {
+            DataBuf psData = readRawProfile(arr);
+            if (psData.size_ > 0) {
+                Blob iptcBlob;
+                const byte *record = 0;
+                uint32_t sizeIptc = 0;
+                uint32_t sizeHdr = 0;
+
+                const byte* pEnd = psData.pData_ + psData.size_;
+                const byte* pCur = psData.pData_;
+                while (   pCur < pEnd
+                       && 0 == Photoshop::locateIptcIrb(pCur,
+                                                        static_cast<long>(pEnd - pCur),
+                                                        &record,
+                                                        &sizeHdr,
+                                                        &sizeIptc)) {
+                    if (sizeIptc) {
+#ifdef DEBUG
+                        std::cerr << "Found IPTC IRB, size = " << sizeIptc << "
";
+#endif
+                        append(iptcBlob, record + sizeHdr, sizeIptc);
+                    }
+                    pCur = record + sizeHdr + sizeIptc;
+                    pCur += (sizeIptc & 1);
+                }
+                if (   iptcBlob.size() > 0
+                    && IptcParser::decode(pImage->iptcData(),
+                                          &iptcBlob[0],
+                                          static_cast<uint32_t>(iptcBlob.size()))) {
+#ifndef SUPPRESS_WARNINGS
+                    std::cerr << "Warning: Failed to decode IPTC metadata.
";
+#endif
+                    pImage->clearIptcData();
+                }
+                // If there is no IRB, try to decode the complete chunk data
+                if (   iptcBlob.empty()
+                    && IptcParser::decode(pImage->iptcData(),
+                                          psData.pData_,
+                                          psData.size_)) {
+#ifndef SUPPRESS_WARNINGS
+                    std::cerr << "Warning: Failed to decode IPTC metadata.
";
+#endif
+                    pImage->clearIptcData();
+                }
+            } // if (psData.size_ > 0)
         }
 
         // We look if an ImageMagick XMP raw profile exist.

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list