[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=d109589

The following commit has been merged in the master branch:
commit d1095892671a5defdb8ba1427707d2095dd5e528
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Wed Mar 21 14:22:47 2012 +0000

    Added support for CR2 IFD2 image preview. (An uncompressed TIFF image without white-balance correction.)
---
 src/preview.cpp       | 37 ++++++++++++++-----------------------
 src/tiffimage.cpp     |  2 +-
 src/tiffimage_int.hpp |  5 +++--
 3 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/src/preview.cpp b/src/preview.cpp
index b4f79f0..357f474 100644
--- a/src/preview.cpp
+++ b/src/preview.cpp
@@ -46,6 +46,7 @@ EXIV2_RCSID("@(#) $Id$")
 #include "cr2image.hpp"
 #include "jpgimage.hpp"
 #include "tiffimage.hpp"
+#include "tiffimage_int.hpp"
 
 // *****************************************************************************
 namespace {
@@ -329,6 +330,7 @@ namespace {
         { 0,                       createLoaderTiff,         4 },
         { 0,                       createLoaderTiff,         5 },
         { 0,                       createLoaderTiff,         6 },
+        { "image/x-canon-cr2",     createLoaderTiff,         7 },
         { 0,                       createLoaderExifJpeg,     0 },
         { 0,                       createLoaderExifJpeg,     1 },
         { 0,                       createLoaderExifJpeg,     2 },
@@ -373,7 +375,8 @@ namespace {
         { "SubImage3", "Exif.SubImage3.NewSubfileType", "1" },  // 3
         { "SubImage4", "Exif.SubImage4.NewSubfileType", "1" },  // 4
         { "SubThumb1", "Exif.SubThumb1.NewSubfileType", "1" },  // 5
-        { "Thumbnail", 0,                               0   }   // 6
+        { "Thumbnail", 0,                               0   },  // 6
+        { "Image2",    0,                               0   }   // 7
     };
 
     Loader::AutoPtr Loader::create(PreviewId id, const Image &image)
@@ -764,34 +767,17 @@ namespace {
         // copy tags
         for (ExifData::const_iterator pos = exifData.begin(); pos != exifData.end(); ++pos) {
             if (pos->groupName() == group_) {
-
                 /*
-                   write only the neccessary tags
+                   Write only the neccessary TIFF image tags
                    tags that especially could cause problems are:
                    "NewSubfileType" - the result is no longer a thumbnail, it is a standalone image
                    "Orientation" - this tag typically appears only in the "Image" group. Deleting it ensures
                                    consistent result for all previews, including JPEG
                 */
-                std::string name = pos->tagName();
-                if (name != "ImageWidth" &&
-                    name != "ImageLength" &&
-                    name != "BitsPerSample" &&
-                    name != "Compression" &&
-                    name != "PhotometricInterpretation" &&
-                    name != "StripOffsets" &&
-                    name != "SamplesPerPixel" &&
-                    name != "RowsPerStrip" &&
-                    name != "StripByteCounts" &&
-                    name != "XResolution" &&
-                    name != "YResolution" &&
-                    name != "ResolutionUnit" &&
-                    name != "ColorMap" &&
-                    name != "TileWidth" &&
-                    name != "TileLength" &&
-                    name != "TileOffsets" &&
-                    name != "TileByteCounts") continue;
-
-                preview.add(ExifKey("Exif.Image." + pos->tagName()), &pos->value());
+                uint16_t tag = pos->tag();
+                if (tag != 0x00fe && tag != 0x00ff && Internal::isTiffImageTag(tag, Internal::ifd0Id)) {
+                    preview.add(ExifKey(tag, "Image"), &pos->value());
+                }
             }
         }
 
@@ -834,6 +820,11 @@ namespace {
             }
         }
 
+        // Fix compression value in the CR2 IFD2 image
+        if (0 == strcmp(group_, "Image2") && image_.mimeType() == "image/x-canon-cr2") {
+            preview["Exif.Image.Compression"] = uint16_t(1);
+        }
+
         // write new image
         MemIo mio;
         IptcData emptyIptc;
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index adc633e..323ed87 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -2080,7 +2080,7 @@ namespace Exiv2 {
         return false;
     }
 
-    bool TiffHeaderBase::isTiffImageTag(uint16_t tag, IfdId group) const
+    bool isTiffImageTag(uint16_t tag, IfdId group)
     {
         //! List of TIFF image tags
         static const TiffImgTagStruct tiffImageTags[] = {
diff --git a/src/tiffimage_int.hpp b/src/tiffimage_int.hpp
index 4ce3ebd..3e233d6 100644
--- a/src/tiffimage_int.hpp
+++ b/src/tiffimage_int.hpp
@@ -131,8 +131,6 @@ 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:
@@ -144,6 +142,9 @@ namespace Exiv2 {
 
     }; // class TiffHeaderBase
 
+    //! Convenience function to check if tag, group is in the list of TIFF image tags.
+    bool isTiffImageTag(uint16_t tag, IfdId group);
+
     /*!
       @brief Standard TIFF header structure.
      */

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list