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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:39:48 UTC 2017


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

The following commit has been merged in the master branch:
commit 8ba7cc5744edde8df87587c56a0d8da4f2a15b87
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Thu Sep 18 10:55:00 2008 +0000

    Moved PreviewId out of the properties struct and minor tweaks.
---
 src/preview.cpp | 57 ++++++++++++++++++++++++++++++++++-----------------------
 src/preview.hpp | 24 ++++++++----------------
 2 files changed, 42 insertions(+), 39 deletions(-)

diff --git a/src/preview.cpp b/src/preview.cpp
index 419d951..b4dede9 100644
--- a/src/preview.cpp
+++ b/src/preview.cpp
@@ -44,7 +44,23 @@ EXIV2_RCSID("@(#) $Id$")
 #include "image.hpp"
 #include "cr2image.hpp"
 
+// *****************************************************************************
+namespace {
+    /*!
+      @brief Compare two preview images by length. Return true if the 
+             lhs is smaller than rhs.
+     */
+    bool cmpPreviewProperties(
+        const Exiv2::PreviewProperties& lhs,
+        const Exiv2::PreviewProperties& rhs
+    )
+    {
+        return lhs.length_ < rhs.length_;
+    }
+}
 
+// *****************************************************************************
+// class member definitions
 namespace Exiv2 {
 
     /*!
@@ -53,13 +69,13 @@ namespace Exiv2 {
      */
     class Loader {
     protected:
-        Loader(PreviewProperties::PreviewId id, const Image &image);
+        Loader(PreviewId id, const Image &image);
 
     public:
         typedef std::auto_ptr<Loader> AutoPtr;
 
         //! Create a Loader subclass for requested id
-        static Loader::AutoPtr create(PreviewProperties::PreviewId id, const Image &image);
+        static Loader::AutoPtr create(PreviewId id, const Image &image);
 
         //! Check if a preview image with given params exists in the image
         virtual bool valid() const = 0;
@@ -71,10 +87,10 @@ namespace Exiv2 {
         virtual DataBuf getData() const = 0;
 
         //! A number of image loaders configured in the loaderList_ table
-        static PreviewProperties::PreviewId getNumLoaders();
+        static PreviewId getNumLoaders();
         
     protected:
-        typedef AutoPtr (*CreateFunc)(PreviewProperties::PreviewId id, const Image &image, int parIdx);
+        typedef AutoPtr (*CreateFunc)(PreviewId id, const Image &image, int parIdx);
 
         struct LoaderList {
             const char *imageMimeType_; //!< Image type for which is the loader valid, NULL matches all images
@@ -85,7 +101,7 @@ namespace Exiv2 {
 
         static const LoaderList loaderList_[]; // PreviewId is an index to this table
 
-        PreviewProperties::PreviewId id_;
+        PreviewId id_;
         const Image &image_;
     };
 
@@ -93,7 +109,7 @@ namespace Exiv2 {
     //! Loader for Jpeg previews that are not read into ExifData directly
     class LoaderExifJpeg : public Loader {
     public:
-        LoaderExifJpeg(PreviewProperties::PreviewId id, const Image &image, int parIdx);
+        LoaderExifJpeg(PreviewId id, const Image &image, int parIdx);
 
         virtual bool valid() const;
         virtual PreviewProperties getProperties() const;
@@ -117,13 +133,13 @@ namespace Exiv2 {
         ExifKey lengthKey_;
     };
 
-    Loader::AutoPtr createLoaderExifJpeg(PreviewProperties::PreviewId id, const Image &image, int parIdx);
+    Loader::AutoPtr createLoaderExifJpeg(PreviewId id, const Image &image, int parIdx);
 
 
     //! Loader for standard Exif thumbnail - just a wrapper around ExifThumbC
     class LoaderExifThumbC : public Loader {
     public:
-        LoaderExifThumbC(PreviewProperties::PreviewId id, const Image &image);
+        LoaderExifThumbC(PreviewId id, const Image &image);
 
         virtual bool valid() const;
         virtual PreviewProperties getProperties() const;
@@ -133,7 +149,7 @@ namespace Exiv2 {
 	ExifThumbC thumb_;
     };
 
-    Loader::AutoPtr createLoaderExifThumbC(PreviewProperties::PreviewId id, const Image &image, int parIdx);
+    Loader::AutoPtr createLoaderExifThumbC(PreviewId id, const Image &image, int parIdx);
 
 // *****************************************************************************
 // class member definitions
@@ -193,7 +209,7 @@ namespace Exiv2 {
         return properties_.length_;
     }
 
-    Loader::AutoPtr Loader::create(PreviewProperties::PreviewId id, const Image &image)
+    Loader::AutoPtr Loader::create(PreviewId id, const Image &image)
     {
             if (id < 0 || id >= Loader::getNumLoaders())
                 return AutoPtr();
@@ -208,7 +224,7 @@ namespace Exiv2 {
             return loader;
     }
 
-    Loader::Loader(PreviewProperties::PreviewId id, const Image &image)
+    Loader::Loader(PreviewId id, const Image &image)
             : id_(id), image_(image)
     {
     }
@@ -220,19 +236,19 @@ namespace Exiv2 {
         return prop;
     }
 
-    PreviewProperties::PreviewId Loader::getNumLoaders()
+    PreviewId Loader::getNumLoaders()
     {
-        return (PreviewProperties::PreviewId)EXV_COUNTOF(loaderList_);
+        return (PreviewId)EXV_COUNTOF(loaderList_);
     }
 
-    LoaderExifJpeg::LoaderExifJpeg(PreviewProperties::PreviewId id, const Image &image, int parIdx)
+    LoaderExifJpeg::LoaderExifJpeg(PreviewId id, const Image &image, int parIdx)
             : Loader(id, image), 
               offsetKey_(param_[parIdx].offsetKey_),
               lengthKey_(param_[parIdx].lengthKey_)
     {
     }
 
-    Loader::AutoPtr createLoaderExifJpeg(PreviewProperties::PreviewId id, const Image &image, int parIdx)
+    Loader::AutoPtr createLoaderExifJpeg(PreviewId id, const Image &image, int parIdx)
     {
             return Loader::AutoPtr(new LoaderExifJpeg(id, image, parIdx));
     }
@@ -295,13 +311,13 @@ namespace Exiv2 {
     }
 
 
-    LoaderExifThumbC::LoaderExifThumbC(PreviewProperties::PreviewId id, const Image &image)
+    LoaderExifThumbC::LoaderExifThumbC(PreviewId id, const Image &image)
             : Loader(id, image), 
               thumb_(image_.exifData())
     {
     }
 
-    Loader::AutoPtr createLoaderExifThumbC(PreviewProperties::PreviewId id, const Image &image, int /* parIdx */)
+    Loader::AutoPtr createLoaderExifThumbC(PreviewId id, const Image &image, int /* parIdx */)
     {
         return Loader::AutoPtr(new LoaderExifThumbC(id, image));
     }
@@ -325,11 +341,6 @@ namespace Exiv2 {
         return thumb_.copy();
     }
 
-    bool cmpPreviewProperties(const PreviewProperties& lhs, const PreviewProperties& rhs)
-    {
-        return lhs.length_ < rhs.length_;
-    }
-
     PreviewImageLoader::PreviewImageLoader(const Image& image)
             : image_(image)
     {
@@ -339,7 +350,7 @@ namespace Exiv2 {
     {
         PreviewPropertiesList list;
         // go through the loader table and store all successfuly created loaders in the list
-        for (PreviewProperties::PreviewId id = 0; id < Loader::getNumLoaders(); id++) {
+        for (PreviewId id = 0; id < Loader::getNumLoaders(); id++) {
             Loader::AutoPtr loader = Loader::create(id, image_);
             if (loader.get()) {
                 list.push_back(loader->getProperties());
diff --git a/src/preview.hpp b/src/preview.hpp
index 13fedf7..b104276 100644
--- a/src/preview.hpp
+++ b/src/preview.hpp
@@ -42,15 +42,13 @@ namespace Exiv2 {
 // *****************************************************************************
 // class definitions
 
+    //! Type of preview image.
+    typedef int PreviewId;
+
     /*!
       @brief Preview image properties.
      */
-    struct PreviewProperties
-    {
-    public:
-        //! type of preview image.
-        typedef int PreviewId;
-    
+    struct PreviewProperties {
         //! Preview image mime type.
         const char* mimeType_;
 
@@ -60,7 +58,7 @@ namespace Exiv2 {
         //! Preview image length in bytes.
         long length_;
 
-        //! identifies type of preview image.
+        //! Identifies type of preview image.
         PreviewId id_;
     };
 
@@ -68,12 +66,6 @@ namespace Exiv2 {
     typedef std::vector<PreviewProperties> PreviewPropertiesList;
 
     /*!
-      @brief Compare two preview images by length. Return true if the 
-             lhs is smaller than rhs.
-     */
-    bool cmpPreviewProperties(const PreviewProperties& lhs, const PreviewProperties& rhs);
-
-    /*!
       @brief Class that holds preview image properties and data buffer.
      */
     class PreviewImage {
@@ -106,12 +98,12 @@ namespace Exiv2 {
         */
         long writeFile(const std::string& path) const;
         /*!
-          @brief Return the MIME type of the thumbnail, either 
-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list