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


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

The following commit has been merged in the master branch:
commit 85cc2f745de635c45f846c7afe2578592310f2d2
Author: draekko <draekko.software at gmail.com>
Date:   Thu Aug 11 19:47:48 2016 +0000

    #1199 Fixed crash with iptc by disabling it, updated decodeChunk to do better header checks, added hexdump function.
---
 include/exiv2/webpimage.hpp |   3 +
 src/image.cpp               |   2 +-
 src/webpimage.cpp           | 178 ++++++++++++++++++++++++++++++++++----------
 3 files changed, 142 insertions(+), 41 deletions(-)

diff --git a/include/exiv2/webpimage.hpp b/include/exiv2/webpimage.hpp
index f1306b3..b4165c2 100644
--- a/include/exiv2/webpimage.hpp
+++ b/include/exiv2/webpimage.hpp
@@ -91,7 +91,10 @@ namespace Exiv2 {
         EXV_DLLLOCAL void doWriteMetadata(BasicIo& outIo);
         //! @name NOT Implemented
         //@{
+        long getHeaderOffset(byte *data, long data_size,
+                             byte *header, long header_size);
         bool equalsWebPTag(Exiv2::DataBuf& buf ,const char* str);
+        void debugPrintHex(byte *data, long size);
         void decodeChunks(uint64_t filesize);
         void inject_VP8X(BasicIo& iIo, bool has_xmp, bool has_exif,
                          bool has_alpha, bool has_icc, int width,
diff --git a/src/image.cpp b/src/image.cpp
index b40ba61..4a08639 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, amReadWrite, amReadWrite, amNone      },
+        { ImageType::webp, newWebPInstance, isWebPType, amReadWrite, amNone,      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      },
diff --git a/src/webpimage.cpp b/src/webpimage.cpp
index 0159af3..75fec6e 100644
--- a/src/webpimage.cpp
+++ b/src/webpimage.cpp
@@ -55,7 +55,6 @@
 
 #define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
 
-
 // *****************************************************************************
 // class member definitions
 namespace Exiv2 {
@@ -113,6 +112,10 @@ namespace Exiv2 {
         if (!io_->isopen()) throw Error(20);
         if (!outIo.isopen()) throw Error(21);
 
+#ifdef DEBUG
+        std::cout << "Writing metadata" << std::endl;
+#endif
+
         byte data[12];
         DataBuf chunkId(5);
         const int TAG_SIZE = 4;
@@ -133,22 +136,22 @@ namespace Exiv2 {
         bool has_alpha = false;
         bool has_icc = false;
 
-        int height;
-        int width;
+        int width = 0;
+        int height = 0;
 
         byte size_buff[4];
         std::string xmpData;
         Blob blob;
 
-#ifdef SVN_VERSION
-        if (iccProfile_.count() > 0) {
+        if (iccProfile_.size_ > 0) {
             has_icc = true;
         }
-#endif
 
+#ifdef __USE_IPTC__
         if (iptcData_.count() > 0) {
             // do nothing for now
         }
+#endif
 
         if (exifData_.count() > 0) {
             ExifParser::encode(blob, littleEndian, exifData_);
@@ -158,8 +161,10 @@ namespace Exiv2 {
         }
 
         if (xmpData_.count() > 0) {
+#ifdef __USE_IPTC__
             copyIptcToXmp(iptcData_, xmpData_);
             copyExifToXmp(exifData_, xmpData_);
+#endif
             XmpParser::encode(xmpPacket_, xmpData_,
                               XmpParser::useCompactFormat |
                               XmpParser::omitAllFormatting);
@@ -285,7 +290,6 @@ namespace Exiv2 {
                 }
             }
 
-            std::cout << "VP8X res. size [" << width << "x" << height << "]
";
             /* Inject a VP8X chunk if one isn't available. */
             if (!has_vp8x) {
                 inject_VP8X(outIo, has_xmp, has_exif, has_alpha,
@@ -329,16 +333,14 @@ namespace Exiv2 {
                     throw Error(21);
                 if (outIo.write(payload.pData_, payload.size_) != payload.size_)
                     throw Error(21);
-#ifdef SVN_VERSION
             } else if (equalsWebPTag(chunkId, "ICCP") && has_icc) {
-                ul2Data(size_buff, iptcData_.size(), littleEndian);
+                ul2Data(size_buff, iccProfile_.size_, littleEndian);
                 if (outIo.write(chunkId.pData_, TAG_SIZE) != TAG_SIZE)
                     throw Error(21);
                 if (outIo.write(size_buff, 4) != 4)
                     throw Error(21);
-                if (outIo.write(iccProfile_, iccProfile_.size_) != iccProfile_.size_)
+                if (outIo.write(iccProfile_.pData_, iccProfile_.size_) != iccProfile_.size_)
                     throw Error(21);
-#endif
             } else if (equalsWebPTag(chunkId, "EXIF")) {
                 // Skip and add new data afterwards
             } else if (equalsWebPTag(chunkId, "XMP ")) {
@@ -357,7 +359,7 @@ namespace Exiv2 {
             // Check for extra 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list