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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:46:45 UTC 2017


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

The following commit has been merged in the master branch:
commit 027b3917ecaae7f30526a5024747280fca26ca2c
Author: Robin Mills <robin at clanmills.com>
Date:   Sat Aug 20 14:11:54 2016 +0000

    #1199 Spit'n'polish on the loops in printStructure(), metadataRead() and doWriteMetadata().  Added tests with even byte count for ICCP and XMP Chunks.
---
 src/webpimage.cpp       | 36 ++++++++----------------------------
 test/data/webp-test.out | 16 ++++++++++++++++
 test/webp-test.sh       | 23 +++++++++++++++++------
 3 files changed, 41 insertions(+), 34 deletions(-)

diff --git a/src/webpimage.cpp b/src/webpimage.cpp
index 4dc2443..c6a4c2b 100644
--- a/src/webpimage.cpp
+++ b/src/webpimage.cpp
@@ -182,7 +182,7 @@ namespace Exiv2 {
         /* Verify for a VP8X Chunk First before writing in
          case we have any exif or xmp data, also check
          for any chunks with alpha frame/layer set */
-        while (!io_->eof()) {
+        while ( !io_->eof() && (uint64_t) io_->tell() < filesize) {
             io_->read(chunkId.pData_, WEBP_TAG_SIZE);
             io_->read(size_buff, WEBP_TAG_SIZE);
             long size = Exiv2::getULong(size_buff, littleEndian);
@@ -306,13 +306,7 @@ namespace Exiv2 {
         }
 
         io_->seek(12, BasicIo::beg);
-
-        while (!io_->eof()) {
-            uint64_t offset = io_->tell();
-            if (offset >= filesize) {
-                break;
-            }
-
+        while ( !io_->eof() && (uint64_t) io_->tell() < filesize) {
             io_->read(chunkId.pData_, 4);
             io_->read(size_buff, 4);
 
@@ -375,19 +369,10 @@ namespace Exiv2 {
                     throw Error(21);
             }
 
-            if (outIo.tell() % 2) { // pad
-                if (outIo.write(&WEBP_PAD_ODD, 1) != 1) throw Error(21);
-            }
-            offset = io_->tell();
-
             // Encoder required to pad odd sized data with a null byte
             if (outIo.tell() % 2) {
                 if (outIo.write(&WEBP_PAD_ODD, 1) != 1) throw Error(21);
             }
-
-            if (offset >= filesize) {
-                break;
-            }
         }
 
         if (has_exif) {
@@ -456,13 +441,13 @@ namespace Exiv2 {
             }
 
             io_->seek(0,BasicIo::beg); // rewind
-            uint64_t offset = (uint64_t) io_->tell();
-            while (!io_->eof() && offset < filesize ) {
+            while ( !io_->eof() && (uint64_t) io_->tell() < filesize) {
+                uint64_t offset = (uint64_t) io_->tell();
                 byte     size_buff[WEBP_TAG_SIZE];
                 io_->read(chunkId.pData_, WEBP_TAG_SIZE);
                 io_->read(size_buff, WEBP_TAG_SIZE);
                 long size = Exiv2::getULong(size_buff, littleEndian);
-                DataBuf payload(offset?size:WEBP_TAG_SIZE); // header is a bit of a dummy! (different from other chunks)
+                DataBuf payload(offset?size:WEBP_TAG_SIZE); // header is different from chunks
                 io_->read(payload.pData_, payload.size_);
 
                 if ( bPrint ) {
@@ -485,8 +470,7 @@ namespace Exiv2 {
                     out.write((const char*) payload.pData_,payload.size_);
                 }
 
-                if ( offset && (payload.size_ % 2)) io_->read(size_buff,1); // skip padding byte on sub-chunks
-                offset = (uint64_t) io_->tell();
+                if ( offset && io_->tell() % 2 ) io_->seek(+1, BasicIo::cur); // skip padding byte on sub-chunks
             }
         }
     }
@@ -518,18 +502,14 @@ namespace Exiv2 {
     {
         DataBuf   chunkId(5);
         byte      size_buff[WEBP_TAG_SIZE];
-        bool       has_canvas_data = false;
+        bool      has_canvas_data = false;
 
 #ifdef DEBUG
         std::cout << "Reading metadata" << std::endl;
 #endif
 
         chunkId.pData_[4] = '

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list