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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:46:26 UTC 2017


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

The following commit has been merged in the master branch:
commit 00984afaa2182aaa73e0da4fcab9e0091cd17152
Author: Robin Mills <robin at clanmills.com>
Date:   Tue Apr 19 20:17:20 2016 +0000

    #1178 Thanks to Terence for reporting this an providing confidential test data
---
 include/exiv2/image.hpp     | 14 ++++++++++++--
 include/exiv2/orfimage.hpp  |  3 ++-
 include/exiv2/tiffimage.hpp |  2 +-
 src/cr2image.cpp            | 12 ++++++------
 src/crwimage.cpp            | 12 ++++++------
 src/orfimage.cpp            | 23 ++++++++++++-----------
 src/tiffimage.cpp           | 13 +++++++------
 7 files changed, 46 insertions(+), 33 deletions(-)

diff --git a/include/exiv2/image.hpp b/include/exiv2/image.hpp
index aa67171..3ed9932 100644
--- a/include/exiv2/image.hpp
+++ b/include/exiv2/image.hpp
@@ -427,6 +427,16 @@ namespace Exiv2 {
         const NativePreviewList& nativePreviews() const;
         //@}
 
+        void setTypeSupported(
+        	int              imageType,
+            uint16_t         supportedMetadata
+        ) {
+        	imageType_         = imageType;
+        	supportedMetadata_ = supportedMetadata;
+        }
+
+        int imageType() const { return imageType_; }
+
     protected:
         // DATA
         BasicIo::AutoPtr  io_;                //!< Image data IO pointer
@@ -450,8 +460,8 @@ namespace Exiv2 {
         //@}
 
         // DATA
-        const int         imageType_;         //!< Image type
-        const uint16_t    supportedMetadata_; //!< Bitmap with all supported metadata types
+        int               imageType_;         //!< Image type
+        uint16_t          supportedMetadata_; //!< Bitmap with all supported metadata types
         bool              writeXmpFromPacket_;//!< Determines the source when writing XMP
         ByteOrder         byteOrder_;         //!< Byte order
 
diff --git a/include/exiv2/orfimage.hpp b/include/exiv2/orfimage.hpp
index 3e4e424..9ac8f9a 100644
--- a/include/exiv2/orfimage.hpp
+++ b/include/exiv2/orfimage.hpp
@@ -32,6 +32,7 @@
 // *****************************************************************************
 // included header files
 #include "image.hpp"
+#include "tiffimage.hpp"
 #include "basicio.hpp"
 #include "types.hpp"
 
@@ -54,7 +55,7 @@ namespace Exiv2 {
       @brief Class to access raw Olympus ORF images. Exif metadata is supported
              directly, IPTC is read from the Exif data, if present.
      */
-    class EXIV2API OrfImage : public Image {
+    class EXIV2API OrfImage : public TiffImage {
     public:
         //! @name Creators
         //@{
diff --git a/include/exiv2/tiffimage.hpp b/include/exiv2/tiffimage.hpp
index a5e210c..65ff767 100644
--- a/include/exiv2/tiffimage.hpp
+++ b/include/exiv2/tiffimage.hpp
@@ -93,7 +93,7 @@ namespace Exiv2 {
                 not valid (does not look like data of the specific image type).
           @caution This function is not thread safe and intended for exiv2 -p{S|R} as a file debugging aid
          */
-        void printStructure(std::ostream& out, PrintStructureOption option,int depth=-1);
+        virtual void printStructure(std::ostream& out, PrintStructureOption option,int depth=-1);
 
         /*!
           @brief Print out the structure of image file.
diff --git a/src/cr2image.cpp b/src/cr2image.cpp
index 2b8612d..aedd48a 100644
--- a/src/cr2image.cpp
+++ b/src/cr2image.cpp
@@ -255,10 +255,10 @@ namespace Exiv2 {
     {
         if (size < 16) return false;
 
-        if (pData[0] == 0x49 && pData[1] == 0x49) {
+        if (pData[0] == 'I' && pData[0] == pData[1]) {
             setByteOrder(littleEndian);
         }
-        else if (pData[0] == 0x4d && pData[1] == 0x4d) {
+        else if (pData[0] == 'M' && pData[0] == pData[1]) {
             setByteOrder(bigEndian);
         }
         else {
@@ -277,17 +277,17 @@ namespace Exiv2 {
         DataBuf buf(16);
         switch (byteOrder()) {
         case littleEndian:
-            buf.pData_[0] = 0x49;
-            buf.pData_[1] = 0x49;
+            buf.pData_[0] = 'I';
             break;
         case bigEndian:
-            buf.pData_[0] = 0x4d;
-            buf.pData_[1] = 0x4d;
+            buf.pData_[0] = 'M';
             break;
         case invalidByteOrder:
             assert(false);
             break;
         }
+        buf.pData_[1] = buf.pData_[0];
+
         us2Data(buf.pData_ + 2, tag(), byteOrder());
         ul2Data(buf.pData_ + 4, 0x00000010, byteOrder());
         memcpy(buf.pData_ + 8, cr2sig_, 4);
diff --git a/src/crwimage.cpp b/src/crwimage.cpp
index bdb061d..10b6360 100644
--- a/src/crwimage.cpp
+++ b/src/crwimage.cpp
@@ -367,10 +367,10 @@ namespace Exiv2 {
     {
         if (size < 14) throw Error(33);
 
-        if (pData[0] == 0x49 && pData[1] == 0x49) {
+        if (pData[0] == 'I' && pData[0] == pData[1]) {
             byteOrder_ = littleEndian;
         }
-        else if (pData[0] == 0x4d && pData[1] == 0x4d) {
+        else if (pData[0] == 'M' && pData[0] == pData[1]) {
             byteOrder_ = bigEndian;
         }
         else {
@@ -500,12 +500,12 @@ namespace Exiv2 {
         assert(   byteOrder_ == littleEndian
                || byteOrder_ == bigEndian);
         if (byteOrder_ == littleEndian) {
-            blob.push_back(0x49);
-            blob.push_back(0x49);
+            blob.push_back('I');
+            blob.push_back('I');
         }
         else {
-            blob.push_back(0x4d);
-            blob.push_back(0x4d);
+            blob.push_back('M');
+            blob.push_back('M');
         }
         uint32_t o = 2;
         byte buf[4];
diff --git a/src/orfimage.cpp b/src/orfimage.cpp
index fc70971..1290fd3 100644
--- a/src/orfimage.cpp
+++ b/src/orfimage.cpp
@@ -34,6 +34,7 @@ EXIV2_RCSID("@(#) $Id$")
 
 #include "orfimage.hpp"
 #include "orfimage_int.hpp"
+#include "tiffimage.hpp"
 #include "tiffcomposite_int.hpp"
 #include "tiffimage_int.hpp"
 #include "image.hpp"
@@ -53,9 +54,10 @@ namespace Exiv2 {
 
     using namespace Internal;
 
-    OrfImage::OrfImage(BasicIo::AutoPtr io, bool /*create*/)
-        : Image(ImageType::orf, mdExif | mdIptc | mdXmp, io)
+    OrfImage::OrfImage(BasicIo::AutoPtr io, bool create)
+        : TiffImage(/*ImageType::orf, mdExif | mdIptc | mdXmp,*/ io,create)
     {
+    	setTypeSupported(ImageType::orf, mdExif | mdIptc | mdXmp);
     } // OrfImage::OrfImage
 
     std::string OrfImage::mimeType() const
@@ -242,21 +244,20 @@ namespace Exiv2 {
     {
         if (size < 8) return false;
 
-        if (pData[0] == 0x49 && pData[1] == 0x49) {
+        if (pData[0] == 'I' && pData[0] == pData[1]) {
             setByteOrder(littleEndian);
         }
-        else if (pData[0] == 0x4d && pData[1] == 0x4d) {
+        else if (pData[0] == 'M' && pData[0] == pData[1]) {
             setByteOrder(bigEndian);
         }
         else {
             return false;
         }
+
         uint16_t sig = getUShort(pData + 2, byteOrder());
-        if (tag() != sig && 0x5352 != sig) return false; // #658: Added 0x5352 for SP-560UZ
+        if (tag() != sig && 0x5352 != sig) return false; // #658: Added 0x5352 "SR" for SP-560UZ
         sig_ = sig;
         setOffset(getULong(pData + 4, byteOrder()));
-        if (offset() != 0x00000008) return false;
-
         return true;
     } // OrfHeader::read
 
@@ -265,17 +266,17 @@ namespace Exiv2 {
         DataBuf buf(8);
         switch (byteOrder()) {
         case littleEndian:
-            buf.pData_[0] = 0x49;
-            buf.pData_[1] = 0x49;
+            buf.pData_[0] = 'I';
             break;
         case bigEndian:
-            buf.pData_[0] = 0x4d;
-            buf.pData_[1] = 0x4d;
+            buf.pData_[0] = 'M';
             break;
         case invalidByteOrder:
             assert(false);
             break;
         }
+        buf.pData_[1] = buf.pData_[0];
+
         us2Data(buf.pData_ + 2, sig_, byteOrder());
         ul2Data(buf.pData_ + 4, 0x00000008, byteOrder());
         return buf;
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index a515aef..2bf59d9 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -36,6 +36,7 @@ EXIV2_RCSID("@(#) $Id$")
 #include "tiffimage_int.hpp"
 #include "tiffcomposite_int.hpp"
 #include "tiffvisitor_int.hpp"
+#include "orfimage.hpp"
 #include "makernote_int.hpp"
 #include "image.hpp"
 #include "image_int.hpp"
@@ -455,6 +456,7 @@ namespace Exiv2 {
     {
         if (io_->open() != 0) throw Error(9, io_->path(), strError());
         // Ensure that this is the correct image type
+        if ( imageType() == ImageType::none )
         if (!isTiffType(*io_, false)) {
             if (io_->error() || io_->eof()) throw Error(14);
             throw Error(15);
@@ -2326,10 +2328,10 @@ namespace Exiv2 {
     {
         if (!pData || size < 8) return false;
 
-        if (pData[0] == 0x49 && pData[1] == 0x49) {
+        if (pData[0] == 'I' && pData[0] == pData[1]) {
             byteOrder_ = littleEndian;
         }
-        else if (pData[0] == 0x4d && pData[1] == 0x4d) {
+        else if (pData[0] == 'M' && pData[0] == pData[1]) {
             byteOrder_ = bigEndian;
         }
         else {
@@ -2346,17 +2348,16 @@ namespace Exiv2 {
         DataBuf buf(8);
         switch (byteOrder_) {
         case littleEndian:
-            buf.pData_[0] = 0x49;
-            buf.pData_[1] = 0x49;
+            buf.pData_[0] = 'I';
             break;
         case bigEndian:
-            buf.pData_[0] = 0x4d;
-            buf.pData_[1] = 0x4d;
+            buf.pData_[0] = 'M';
             break;
         case invalidByteOrder:
             assert(false);
             break;
         }
+        buf.pData_[1]=buf.pData_[0];
         us2Data(buf.pData_ + 2, tag_, byteOrder_);
         ul2Data(buf.pData_ + 4, 0x00000008, byteOrder_);
         return buf;

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list