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


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

The following commit has been merged in the master branch:
commit bcaa22ae6f51f3c98003fb539e6f8d189134e583
Author: draekko <draekko.software at gmail.com>
Date:   Sat Aug 13 02:23:50 2016 +0000

    #1199 removed warnings in stringToHex, enabled iptc support for WebPImage.
---
 include/exiv2/webpimage.hpp |  1 -
 src/image.cpp               | 53 ++++++++++++++++++++++++++++++++++++++++++++-
 src/webpimage.cpp           | 17 +--------------
 3 files changed, 53 insertions(+), 18 deletions(-)

diff --git a/include/exiv2/webpimage.hpp b/include/exiv2/webpimage.hpp
index b4165c2..534d9f2 100644
--- a/include/exiv2/webpimage.hpp
+++ b/include/exiv2/webpimage.hpp
@@ -80,7 +80,6 @@ namespace Exiv2 {
           @brief Not supported. Calling this function will throw an Error(32).
          */
         void setComment(const std::string& comment);
-        void setIptcData(const IptcData& iptcData);
 
         //! @name Accessors
         //@{
diff --git a/src/image.cpp b/src/image.cpp
index b7906e6..6e2933f 100644
--- a/src/image.cpp
+++ b/src/image.cpp
@@ -113,7 +113,7 @@ namespace {
         { ImageType::crw,  newCrwInstance,  isCrwType,  amReadWrite, amNone,      amNone,      amReadWrite },
         { ImageType::mrw,  newMrwInstance,  isMrwType,  amRead,      amRead,      amRead,      amNone      },
         { ImageType::tiff, newTiffInstance, isTiffType, amReadWrite, amReadWrite, amReadWrite, amNone      },
-        { ImageType::webp, newWebPInstance, isWebPType, amReadWrite, amNone,      amReadWrite, amNone      },
+        { ImageType::webp, newWebPInstance, isWebPType, amReadWrite, amReadWrite, amReadWrite, amNone      },
         { ImageType::dng,  newTiffInstance, isTiffType, amReadWrite, amReadWrite, amReadWrite, amNone      },
         { ImageType::nef,  newTiffInstance, isTiffType, amReadWrite, amReadWrite, amReadWrite, amNone      },
         { ImageType::pef,  newTiffInstance, isTiffType, amReadWrite, amReadWrite, amReadWrite, amNone      },
@@ -698,6 +698,57 @@ namespace Exiv2 {
         return hexOutput.str();
     }
 
+    std::string binaryToHex(const byte *data, size_t size)
+    {
+        std::stringstream hexOutput;
+
+        unsigned long tl = (unsigned long)(size / 16) * 16;
+        unsigned long tl_offset = size - tl;
+
+        hexOutput << "Display Hex Dump [size:" << (unsigned long)size << "]" << std::endl;
+
+        for (unsigned long loop = 0; loop < (unsigned long)size; loop++) {
+            if (data[loop] < 16) {
+                hexOutput << "0";
+            }
+            hexOutput << std::hex << (int)data[loop];
+            if ((loop % 8) == 7) {
+                hexOutput << "  ";
+            }
+            if ((loop % 16) == 15 || loop == (tl + tl_offset - 1)) {
+                int max = 15;
+                if (loop >= tl) {
+                    max = tl_offset - 1;
+                    hexOutput << "  ";
+                    for (unsigned long offset = 0; offset < (unsigned long)(16 - tl_offset); offset++) {
+                        if ((offset % 8) == 7) {
+                            hexOutput << "  ";
+                        }
+                        hexOutput << "   ";
+                    }
+                }
+                hexOutput << " ";
+                unsigned long cutoff = 0;
+                for (unsigned long offset = max; offset >= cutoff; offset--) {
+                    if (offset == (unsigned long)(max - 8)) {
+                        hexOutput << "  ";
+                    }
+                    if ((data[loop - offset]) >= 0x20 &&
+                        (data[loop - offset]) <= 0x7E) {
+                        hexOutput << data[loop - offset];
+                    } else {
+                        hexOutput << ".";
+                    }
+                }
+                hexOutput << std::endl;
+            }
+        }
+
+        hexOutput << std::endl << std::endl << std::endl;
+
+        return hexOutput.str();
+    }
+
 	std::string indent(int32_t d)
     {
     	std::string result ;
diff --git a/src/webpimage.cpp b/src/webpimage.cpp
index f597da6..c99f017 100644
--- a/src/webpimage.cpp
+++ b/src/webpimage.cpp
@@ -75,12 +75,6 @@ namespace Exiv2 {
 
     /* =========================================== */
 
-    void WebPImage::setIptcData(const IptcData& /*iptcData*/)
-    {
-        // not supported
-        throw(Error(32, "IPTC metadata", "WebP"));
-    }
-
     void WebPImage::setComment(const std::string& /*comment*/)
     {
         // not supported
@@ -144,11 +138,9 @@ namespace Exiv2 {
             has_icc = true;
         }
 
-#ifdef __USE_IPTC__
         if (iptcData_.count() > 0) {
-            // do nothing for now
+            copyIptcToXmp(iptcData_, xmpData_);
         }
-#endif
 
         if (exifData_.count() > 0) {
             ExifParser::encode(blob, littleEndian, exifData_);
@@ -158,10 +150,6 @@ namespace Exiv2 {
         }
 
         if (xmpData_.count() > 0) {
-#ifdef __USE_IPTC__
-            copyIptcToXmp(iptcData_, xmpData_);
-            copyExifToXmp(exifData_, xmpData_);
-#endif
             XmpParser::encode(xmpPacket_, xmpData_,
                               XmpParser::useCompactFormat |
                               XmpParser::omitAllFormatting);
@@ -696,10 +684,7 @@ namespace Exiv2 {
 #ifdef DEBUG
                     std::cout << Internal::binaryToHex(xmpData_, xmpData_.size());
 #endif
-#ifdef __USE_IPTC__
                     copyXmpToIptc(xmpData_, iptcData_);
-                    copyXmpToExif(xmpData_, exifData_);
-#endif
                 }
             } else {
                 io_->seek(size, BasicIo::cur);

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list