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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:38:14 UTC 2017


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

The following commit has been merged in the master branch:
commit 4f28e8804bdab73034dde6822792223cf90a68de
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Mon Jan 15 11:44:18 2007 +0000

    Added get and set thumbnail functions to exivsimple project
---
 msvc/exivsimple/exivsimple.cpp | 26 ++++++++++++++++++++++++++
 msvc/exivsimple/exivsimple.h   | 24 ++++++++++++++++++++++--
 2 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/msvc/exivsimple/exivsimple.cpp b/msvc/exivsimple/exivsimple.cpp
index 61cbbe2..fe0d3a0 100644
--- a/msvc/exivsimple/exivsimple.cpp
+++ b/msvc/exivsimple/exivsimple.cpp
@@ -22,6 +22,7 @@
   File:      exivsimple.cpp
   Version:   $Rev$
   Author(s): Brad Schick <brad at robotbattle.com>
+             Christian Kuster <christian at kusti.ch>
   History:   12-Nov-04, brad: created
  */
 // *****************************************************************************
@@ -32,6 +33,7 @@
 #include "exif.hpp"
 #include "iptc.hpp"
 #include <cassert>
+#include <cstring>
 
 struct ImageWrapper
 {
@@ -150,6 +152,30 @@ EXIVSIMPLE_API int ImageData(HIMAGE img, BYTE *buffer, unsigned int size)
     return result;
 }
 
+EXIVSIMPLE_API void SetThumbnail(HIMAGE img, const BYTE *buffer, unsigned int size)
+{
+    ImageWrapper *imgWrap = (ImageWrapper*)img;
+    Exiv2::ExifData &exifData = imgWrap->image->exifData();
+    exifData.setJpegThumbnail(buffer, size);
+}
+
+EXIVSIMPLE_API unsigned int GetThumbnail(HIMAGE img, BYTE *buffer, unsigned int size)
+{
+    ImageWrapper *imgWrap = (ImageWrapper*)img;
+    Exiv2::ExifData &exifData = imgWrap->image->exifData();
+    Exiv2::Thumbnail::AutoPtr thumbnail;
+    thumbnail = exifData.getThumbnail();
+    if (thumbnail.get() == 0) {
+        return 0;
+    }
+    Exiv2::DataBuf buf = thumbnail->copy(exifData);
+    if (buf.size_ > (long)size) {
+        return unsigned int(-1);
+    }
+    memcpy(buffer, buf.pData_, buf.size_);
+    return buf.size_;
+}
+
 // This is weird because iptc and exif have not been "unified". Once
 // they are unified, this DLL should not have to know
 // about either... just generic images, keys, values, etc.
diff --git a/msvc/exivsimple/exivsimple.h b/msvc/exivsimple/exivsimple.h
index f66ce83..91517bf 100644
--- a/msvc/exivsimple/exivsimple.h
+++ b/msvc/exivsimple/exivsimple.h
@@ -22,8 +22,10 @@
   @file    exivsimple.h
   @brief   Limited metadata dll for win32
   @version $Rev$
-  @author  Brad Schick (brad) 
+  @author  Brad Schick (brad)
            <a href="mailto:brad at robotbattle.com">brad at robotbattle.com</a>
+           Christian Kuster (kusti)
+           <a href="mailto:christian at kusti.ch">christian at kusti.ch</a>
   @date    12-Nov-04, brad: created
  */
 #ifndef EXIVSIMPLE_H_
@@ -69,10 +71,28 @@ EXIVSIMPLE_API int EnumMeta(HIMAGE img, METAENUMPROC proc, void *user);
 EXIVSIMPLE_API int AddMeta(HIMAGE img, const char *key, const char *val, DllTypeId type);
 EXIVSIMPLE_API int ModifyMeta(HIMAGE img, const char *key, const char *val, DllTypeId type);
 EXIVSIMPLE_API int RemoveMeta(HIMAGE img, const char *key);
+/*!
+  @brief Set the Thumbnail
+
+  @param img    Handle to the image
+  @param buffer Pointer to the Thumbnail data (JPEG)
+  @param size   Size of the thumbnail in bytes
+*/
+EXIVSIMPLE_API void SetThumbnail(HIMAGE img, const BYTE *buffer, unsigned int size);
+/*!
+  @brief Get the Thumbnail
+
+  @param img    Handle to the image
+  @param buffer Pointer where the thumbnaildata is written to (large enough!)
+  @param size   Size of buffer
+
+  @return size of the thumbnail, 0 if failed to read the thumbnail, 
+          (unsigned int)-1 if buffer is too small.
+*/
+EXIVSIMPLE_API unsigned int GetThumbnail(HIMAGE img, BYTE *buffer, unsigned int size);
 
 #ifdef __cplusplus
 }
 #endif
 
 #endif                                  // #ifndef EXIVSIMPLE_H_
-

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list