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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:47:11 UTC 2017


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

The following commit has been merged in the master branch:
commit 3d77c41e316280e7fdacbef4e61dad6f22b340a9
Author: Robin Mills <robin at clanmills.com>
Date:   Thu Oct 13 12:00:56 2016 +0000

    #1243 Work-in-progress.
---
 src/jp2image.cpp | 40 ++++++++++++++++++----------------------
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git a/src/jp2image.cpp b/src/jp2image.cpp
index d08d69a..412d94b 100644
--- a/src/jp2image.cpp
+++ b/src/jp2image.cpp
@@ -461,25 +461,25 @@ namespace Exiv2
             Jp2BoxHeader      box       = {1,1};
             Jp2BoxHeader      subBox    = {1,1};
             Jp2UuidBox        uuid      = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-            long              address   = io_->tell();
             bool              bLF       = false;
 
-            while (box.length && io_->read((byte*)&box, sizeof(box)) == sizeof(box))
+            while (box.length && box.type != kJp2BoxTypeClose && io_->read((byte*)&box, sizeof(box)) == sizeof(box))
             {
                 position   = io_->tell();
                 box.length = getLong((byte*)&box.length, bigEndian);
                 box.type   = getLong((byte*)&box.type, bigEndian);
 
                 if ( bPrint ) {
-                    out << Internal::stringFormat("%8ld | %8ld | ",address,box.length) << toAscii(box.type) << "      | " ;
+                    out << Internal::stringFormat("%8ld | %8ld | ",position-sizeof(box),box.length) << toAscii(box.type) << "      | " ;
                     bLF = true ;
+                    out.flush();
                 }
+                if ( box.type == kJp2BoxTypeClose ) break;
 
-                if (box.length && box.type != kJp2BoxTypeClose) switch(box.type)
+                switch(box.type)
                 {
                     case kJp2BoxTypeJp2Header:
                     {
-                        long restore = io_->tell();
                         lf(out,bLF);
 
                         while (io_->read((byte*)&subBox, sizeof(subBox)) == sizeof(subBox))
@@ -487,12 +487,15 @@ namespace Exiv2
                             subBox.length = getLong((byte*)&subBox.length, bigEndian);
                             subBox.type   = getLong((byte*)&subBox.type, bigEndian);
 
-                            if (subBox.type == kJp2BoxTypeClose || subBox.length < sizeof(box)) break;
+                            if (subBox.type == kJp2BoxTypeClose || subBox.length < sizeof(box)) break ;
 
                             DataBuf data(subBox.length-sizeof(box));
                             io_->read(data.pData_,data.size_);
-                            if ( bPrint ) out << Internal::stringFormat("%8ld | %8ld |  sub:",restore,subBox.length) << toAscii(subBox.type)
-                                <<" | " << Internal::binaryToString(data,40,0) << std::endl;
+                            if ( bPrint ) {
+                                out << Internal::stringFormat("%8ld | %8ld |  sub:",io_->tell()-sizeof(box),subBox.length) << toAscii(subBox.type)
+                                    <<" | " << Internal::binaryToString(data,40,0) << std::endl;
+                                out.flush();
+                            }
 
                             if(subBox.type == kJp2BoxTypeColorHeader)
                             {
@@ -501,13 +504,8 @@ namespace Exiv2
                                 DataBuf icc(iccLength);
                                 if ( bICC ) out.write((const char*)icc.pData_,icc.size_);
                             }
-
-                            io_->seek(restore,BasicIo::beg);
-                            io_->seek(subBox.length, Exiv2::BasicIo::cur);
-                            restore = io_->tell();
                         }
-                        break;
-                    }
+                    } break;
 
                     case kJp2BoxTypeUuid:
                     {
@@ -532,7 +530,10 @@ namespace Exiv2
                             if (io_->error()) throw Error(14);
                             if (bufRead != rawData.size_) throw Error(20);
 
-                            if ( bPrint )out << Internal::binaryToString(rawData,40,0);
+                            if ( bPrint ){
+                                out << Internal::binaryToString(rawData,40,0);
+                                out.flush();
+                            }
                             lf(out,bLF);
 
                             if(bIsExif && bRecursive && rawData.size_ > 0)
@@ -555,15 +556,10 @@ namespace Exiv2
                                 out.write((const char*)rawData.pData_,rawData.size_);
                             }
                         }
-                        break;
-                    }
+                    } break;
 
-                    default:
-                    {
-                        break;
-                    }
+                    default: break;
                 }
-                address   = io_->tell();
 
                 // Move to the next box.
                 io_->seek(static_cast<long>(position - sizeof(box) + box.length), BasicIo::beg);

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list