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


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

The following commit has been merged in the master branch:
commit 6e19d043efcf8425fdd08cd8a856d1c46528cf10
Author: Robin Mills <robin at clanmills.com>
Date:   Thu Mar 17 22:14:21 2016 +0000

    #1108  Added IPTC parser for tiff.
---
 src/image.cpp     |  9 ++++++---
 src/image_int.hpp |  5 +++++
 src/tiffimage.cpp | 25 ++++++++++++++++++++++---
 3 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/src/image.cpp b/src/image.cpp
index 9e8ddf4..38ffc28 100644
--- a/src/image.cpp
+++ b/src/image.cpp
@@ -609,11 +609,9 @@ namespace Exiv2 {
         return result;
     }
 
-    std::string binaryToString(DataBuf& buf, size_t size, size_t start /*=0*/)
+    std::string binaryToString(const byte* buff, size_t size, size_t start /*=0*/)
     {
         std::string result = "";
-        byte* buff = buf.pData_;
-
         size += start;
 
         while (start < size) {
@@ -627,4 +625,9 @@ namespace Exiv2 {
         return result;
     }
 
+    std::string binaryToString(DataBuf& buf, size_t size, size_t start /*=0*/)
+    {
+        return binaryToString(buf.pData_,size,start);
+    }
+
 }}                                      // namespace Internal, Exiv2
diff --git a/src/image_int.hpp b/src/image_int.hpp
index 00f1a30..a96445d 100644
--- a/src/image_int.hpp
+++ b/src/image_int.hpp
@@ -60,6 +60,11 @@ namespace Exiv2 {
      */
     std::string binaryToString(DataBuf& buf, size_t size, size_t start =0);
 
+    /*!
+      @brief format binary for display in \em printStructure() \em .
+     */
+    std::string binaryToString(const byte* buff, size_t size, size_t start /*=0*/);
+
 }}                                      // namespace Internal, Exiv2
 
 #endif                                  // #ifndef IMAGE_INT_HPP_
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index d41934b..8efcb74 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -574,12 +574,31 @@ namespace Exiv2 {
 
                     sp = kount == count ? "" : " ...";
                     out << sp << std::endl;
-                    if ( option == kpsRecursive
-                    && (tag == 0x8769 /* ExifTag */ /* || tag == 0x927c MakerNote */)
-                    ){
+                    if ( option == kpsRecursive && tag == 0x8769 /* ExifTag */ ) {
                         size_t restore = io.tell();
                         printIFDStructure(io,out,option,Offset,bSwap,c,depth);
                         io.seek(restore,BasicIo::beg);
+                    } else if ( option == kpsRecursive && tag == 0x83bb /* IPTCNAA */ ) {
+                        size_t   restore = io.tell();  // save
+                        io.seek(offset,BasicIo::beg);  // position
+                        byte* bytes=new byte[count] ;  // allocate memory
+                        io.read(bytes,count)        ;  // read
+                        io.seek(restore,BasicIo::beg); // restore
+
+						uint32_t i     = 0 ;
+						while  ( i < count-3 && bytes[i] != 0x1c ) i++;
+						out << "  Record | DataSet | Name                     | Length | Data" << std::endl;
+						while ( bytes[i] == 0x1c && i < size-3 ) {
+							char buff[100];
+							uint16_t record  = bytes[i+1];
+							uint16_t dataset = bytes[i+2];
+							uint16_t len     = getUShort(bytes+i+3,bigEndian);
+							sprintf(buff,"  %6d | %7d | %-24s | %6d | ",record,dataset, Exiv2::IptcDataSets::dataSetName(dataset,record).c_str(), len);
+
+                            out << buff << Internal::binaryToString(bytes,(len>40?40:len),i+5) << (len>40?"...":"") << std::endl;
+							i += 5 + len;
+						}
+                        delete[] bytes;
                     }
                 }
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list