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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:36:28 UTC 2017


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

The following commit has been merged in the master branch:
commit 3156f53a25e908eac051197e69d0ce9216ed2af4
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Jun 20 06:29:14 2004 +0000

    Delete Exif section from the file when writing an empty ExifData
---
 src/exif.cpp | 18 +++++++++++-------
 src/exif.hpp |  9 +++++----
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/src/exif.cpp b/src/exif.cpp
index 7b32a26..793604c 100644
--- a/src/exif.cpp
+++ b/src/exif.cpp
@@ -20,14 +20,14 @@
  */
 /*
   File:      exif.cpp
-  Version:   $Name:  $ $Revision: 1.46 $
+  Version:   $Name:  $ $Revision: 1.47 $
   Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
   History:   26-Jan-04, ahu: created
              11-Feb-04, ahu: isolated as a component
  */
 // *****************************************************************************
 #include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.46 $ $RCSfile: exif.cpp,v $")
+EXIV2_RCSID("@(#) $Name:  $ $Revision: 1.47 $ $RCSfile: exif.cpp,v $")
 
 // Define DEBUG_MAKERNOTE to output debug information to std::cerr
 #undef DEBUG_MAKERNOTE
@@ -667,6 +667,9 @@ namespace Exiv2 {
 
     int ExifData::write(const std::string& path) 
     {
+        // Remove the Exif section from the file if there is no metadata 
+        if (count() == 0 && !pThumbnail_) return erase(path);
+
         std::ifstream is(path.c_str(), std::ios::binary);
         if (!is) return -1;
         Image* pImage = ImageFactory::instance().create(is);
@@ -954,7 +957,7 @@ namespace Exiv2 {
             pThumbnail_ = 0;
         }
         return delta;
-    }
+    } // ExifData::eraseThumbnail
 
     bool ExifData::stdThumbPosition() const
     {
@@ -986,7 +989,7 @@ namespace Exiv2 {
                 || maxOffset > pThumbnail_->offset()) rc = false;
         }
         return rc;
-    }
+    } // ExifData::stdThumbPosition
 
     int ExifData::readThumbnail()
     {
@@ -1111,7 +1114,7 @@ namespace Exiv2 {
             }
         }
         return rc;
-    }
+    } // ExifData::findEntry
 
     const Ifd* ExifData::getIfd(IfdId ifdId) const
     {
@@ -1137,7 +1140,7 @@ namespace Exiv2 {
             break;
         }
         return ifd;
-    }
+    } // ExifData::getIfd
 
     std::string ExifData::strError(int rc, const std::string& path)
     {
@@ -1241,7 +1244,8 @@ namespace Exiv2 {
 
         DataBuf buf(md.size());
         md.copy(buf.pData_, byteOrder);
-        e.setValue(static_cast<uint16>(md.typeId()), md.count(), buf.pData_, md.size()); 
+        e.setValue(static_cast<uint16>(md.typeId()), md.count(),
+                   buf.pData_, md.size()); 
         makerNote->add(e);
     } // addToMakerNote
 
diff --git a/src/exif.hpp b/src/exif.hpp
index f564bb8..e4d50ba 100644
--- a/src/exif.hpp
+++ b/src/exif.hpp
@@ -21,7 +21,7 @@
 /*!
   @file    exif.hpp
   @brief   Encoding and decoding of Exif data
-  @version $Name:  $ $Revision: 1.46 $
+  @version $Name:  $ $Revision: 1.47 $
   @author  Andreas Huggel (ahu)
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    09-Jan-04, ahu: created
@@ -546,9 +546,10 @@ namespace Exiv2 {
         int read(const char* buf, long len);
         /*!
           @brief Write the Exif data to file path. If an Exif data section
-                 already exists in the file, it is replaced. Otherwise, an
-                 Exif data section is created. See copy(char* buf) for further
-                 details.
+                 already exists in the file, it is replaced.  If there is no
+                 metadata and no thumbnail to write, the Exif data section is
+                 deleted from the file.  Otherwise, an Exif data section is
+                 created. See copy(char* buf) for further details.
 
           @return 0 if successful.
          */

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list