[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=95baab1

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

    533: Applied patch 3_skip_writing_redundant_IPTC_IRBs (Michael Ulbrich, Volker Grabsch)
---
 src/jpgimage.cpp | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp
index f4ed679..10ac5b7 100644
--- a/src/jpgimage.cpp
+++ b/src/jpgimage.cpp
@@ -210,15 +210,23 @@ namespace Exiv2 {
             // Data is padded to be even (but not included in size)
             if (rawIptc.size_ & 1) psBlob.push_back(0x00);
         }
-        // Write existing stuff after record, data is rounded to be even.
-        const uint32_t sizeOldData = sizeHdr + sizeIptc + (sizeIptc & 1);
-        // Note: Because of the rounding, sizeFront + sizeOldData can be
-        // _greater_ than sizePsData by 1 (not just equal), if the original
-        // data was not padded.
-        if (static_cast<uint32_t>(sizePsData) > sizeFront + sizeOldData) {
-            append(psBlob, record + sizeOldData,
-                   sizePsData - sizeFront - sizeOldData);
+        // Write existing stuff after record,
+        // skip the current and all remaining IPTC blocks
+        long pos = sizeFront;
+        while (0 == Photoshop::locateIptcIrb(pPsData + pos, sizePsData - pos,
+                                             &record, &sizeHdr, &sizeIptc)) {
+            const long newPos = static_cast<long>(record - pPsData);
+            // Copy data up to the IPTC IRB
+            if (newPos > pos) {
+                append(psBlob, pPsData + pos, newPos - pos);
+            }
+            // Skip the IPTC IRB
+            pos = newPos + sizeHdr + sizeIptc + (sizeIptc & 1);
+        }
+        if (pos < sizePsData) {
+            append(psBlob, pPsData + pos, sizePsData - pos);
         }
+        // Data is rounded to be even
         if (psBlob.size() > 0) rc = DataBuf(&psBlob[0], static_cast<long>(psBlob.size()));
 #ifdef DEBUG
         std::cerr << "IRB block at the end of Photoshop::setIptcIrb
";

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list