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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:42:35 UTC 2017


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

The following commit has been merged in the master branch:
commit da6051a3a06cd72eaa4b5e21df26e6eaeaa2d587
Author: vog <vog at notjusthosting.com>
Date:   Mon Jul 18 15:24:16 2011 +0000

    Added the possibility to define a filter in the NativePreview mechanism, e.g. for hex decoding
---
 src/epsimage.cpp |  2 ++
 src/image.hpp    |  1 +
 src/preview.cpp  | 12 ++++++++++--
 src/psdimage.cpp |  1 +
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/epsimage.cpp b/src/epsimage.cpp
index 239220b..51741b1 100644
--- a/src/epsimage.cpp
+++ b/src/epsimage.cpp
@@ -697,6 +697,7 @@ namespace {
                 nativePreview.size_ = sizeWmf;
                 nativePreview.width_ = 0;
                 nativePreview.height_ = 0;
+                nativePreview.filter_ = "";
                 nativePreview.mimeType_ = "image/x-wmf";
                 nativePreviews.push_back(nativePreview);
             }
@@ -706,6 +707,7 @@ namespace {
                 nativePreview.size_ = sizeTiff;
                 nativePreview.width_ = 0;
                 nativePreview.height_ = 0;
+                nativePreview.filter_ = "";
                 nativePreview.mimeType_ = "image/tiff";
                 nativePreviews.push_back(nativePreview);
             }
diff --git a/src/image.hpp b/src/image.hpp
index 896696e..b4a8172 100644
--- a/src/image.hpp
+++ b/src/image.hpp
@@ -64,6 +64,7 @@ namespace Exiv2 {
         uint32_t size_;
         uint32_t width_;
         uint32_t height_;
+        std::string filter_;
         std::string mimeType_;
     };
 
diff --git a/src/preview.cpp b/src/preview.cpp
index b78658d..4910c37 100644
--- a/src/preview.cpp
+++ b/src/preview.cpp
@@ -403,10 +403,14 @@ namespace {
     {
         if (!(0 <= parIdx && static_cast<size_t>(parIdx) < image.nativePreviews().size())) return;
         nativePreview_ = image.nativePreviews()[parIdx];
-        size_ = nativePreview_.size_;
         width_ = nativePreview_.width_;
         height_ = nativePreview_.height_;
         valid_ = true;
+        if (nativePreview_.size_ == 0) {
+            size_ = getData().size_;
+        } else {
+            size_ = nativePreview_.size_;
+        }
     }
 
     Loader::AutoPtr createLoaderNative(PreviewId id, const Image &image, int parIdx)
@@ -452,7 +456,11 @@ namespace {
 #endif
             return DataBuf();
         }
-        return DataBuf(data + nativePreview_.position_, nativePreview_.size_);
+        if (nativePreview_.filter_ == "") {
+            return DataBuf(data + nativePreview_.position_, nativePreview_.size_);
+        } else {
+            throw Error(1, "Invalid native preview filter: " + nativePreview_.filter_);
+        }
     }
 
     bool LoaderNative::readDimensions()
diff --git a/src/psdimage.cpp b/src/psdimage.cpp
index db41c55..bd2d2f4 100644
--- a/src/psdimage.cpp
+++ b/src/psdimage.cpp
@@ -334,6 +334,7 @@ namespace Exiv2 {
                     if (io_->error() || io_->eof()) throw Error(14);
 
                     if (format == 1) {
+                        nativePreview.filter_ = "";
                         nativePreview.mimeType_ = "image/jpeg";
                         nativePreviews_.push_back(nativePreview);
                     } else {

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list