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


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

The following commit has been merged in the master branch:
commit 6db7cbf32179ba1381e22beb237e7d74f5abc25f
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Wed Mar 21 09:42:39 2012 +0000

    #635: Identified image tags in CR2 images (just enough to maintain the TIFF structure, not sufficient for dcraw to still read the image)
---
 src/cr2image.cpp      |  8 ++++++++
 src/cr2image_int.hpp  |  3 +++
 src/tiffimage.cpp     | 56 ++++++++++++++++++++++++++++-----------------------
 src/tiffimage_int.hpp |  2 ++
 4 files changed, 44 insertions(+), 25 deletions(-)

diff --git a/src/cr2image.cpp b/src/cr2image.cpp
index e394d56..53ca6c3 100644
--- a/src/cr2image.cpp
+++ b/src/cr2image.cpp
@@ -292,4 +292,12 @@ namespace Exiv2 {
         return buf;
     } // Cr2Header::write
 
+    bool Cr2Header::isImageTag(uint16_t tag, IfdId group, const PrimaryGroups* /*pPrimaryGroups*/) const
+    {
+        // CR2 image tags are all IFD2 and IFD3 tags
+        if (group == ifd2Id || group == ifd3Id) return true;
+        // ...and any (IFD0) tag that is in the TIFF image tags list
+        return isTiffImageTag(tag, group);
+    }
+
 }}                                      // namespace Internal, Exiv2
diff --git a/src/cr2image_int.hpp b/src/cr2image_int.hpp
index 598a872..dfb02b7 100644
--- a/src/cr2image_int.hpp
+++ b/src/cr2image_int.hpp
@@ -66,6 +66,9 @@ namespace Exiv2 {
         //! @name Accessors
         //@{
         DataBuf write() const;
+        bool isImageTag(      uint16_t       tag,
+                              IfdId          group,
+                        const PrimaryGroups* pPrimaryGroups) const;
         //@}
 
         //! Return the address of offset2 from the start of the header
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index 4e9ab36..adc633e 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -2080,19 +2080,7 @@ namespace Exiv2 {
         return false;
     }
 
-    TiffHeader::TiffHeader(ByteOrder byteOrder, uint32_t offset, bool hasImageTags)
-        : TiffHeaderBase(42, 8, byteOrder, offset),
-          hasImageTags_(hasImageTags)
-    {
-    }
-
-    TiffHeader::~TiffHeader()
-    {
-    }
-
-    bool TiffHeader::isImageTag(      uint16_t       tag,
-                                      IfdId          group,
-                                const PrimaryGroups* pPrimaryGroups) const
+    bool TiffHeaderBase::isTiffImageTag(uint16_t tag, IfdId group) const
     {
         //! List of TIFF image tags
         static const TiffImgTagStruct tiffImageTags[] = {
@@ -2163,6 +2151,34 @@ namespace Exiv2 {
             { 0x9217, ifd0Id }, // Exif.Image.SensingMethod
         };
 
+        // If tag, group is one of the image tags listed above -> bingo!
+        if (find(tiffImageTags, TiffImgTagStruct::Key(tag, group))) {
+#ifdef DEBUG
+            ExifKey key(tag, groupName(group));
+            std::cerr << "Image tag: " << key << " (3)
";
+#endif
+            return true;
+        }
+#ifdef DEBUG
+        std::cerr << "Not an image tag: " << key << " (4)
";
+#endif
+        return false;
+    }
+
+    TiffHeader::TiffHeader(ByteOrder byteOrder, uint32_t offset, bool hasImageTags)
+        : TiffHeaderBase(42, 8, byteOrder, offset),
+          hasImageTags_(hasImageTags)
+    {
+    }
+
+    TiffHeader::~TiffHeader()
+    {
+    }
+
+    bool TiffHeader::isImageTag(      uint16_t       tag,
+                                      IfdId          group,
+                                const PrimaryGroups* pPrimaryGroups) const
+    {
         if (!hasImageTags_) {
 #ifdef DEBUG
             std::cerr << "No image tags in this image
";
@@ -2193,18 +2209,8 @@ namespace Exiv2 {
 #endif
             return true;
         }
-        // If tag, group is one of the image tags listed above -> bingo!
-        if (find(tiffImageTags, TiffImgTagStruct::Key(tag, group))) {
-#ifdef DEBUG
-            ExifKey key(tag, groupName(group));
-            std::cerr << "Image tag: " << key << " (3)
";
-#endif
-            return true;
-        }
-#ifdef DEBUG
-        std::cerr << "Not an image tag: " << key << " (4)
";
-#endif
-        return false;
+        // Finally, if tag, group is one of the TIFF image tags -> bingo!
+        return isTiffImageTag(tag, group);
     } // TiffHeader::isImageTag
 
     void OffsetWriter::setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder)
diff --git a/src/tiffimage_int.hpp b/src/tiffimage_int.hpp
index 4575288..4ce3ebd 100644
--- a/src/tiffimage_int.hpp
+++ b/src/tiffimage_int.hpp
@@ -131,6 +131,8 @@ namespace Exiv2 {
         virtual bool isImageTag(      uint16_t       tag,
                                       IfdId          group,
                                 const PrimaryGroups* pPrimaryGroups) const;
+        //! Convenience function to check if tag, group is in the list of TIFF image tags.
+        bool isTiffImageTag(uint16_t tag, IfdId group) const;
         //@}
 
     private:

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list