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


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

The following commit has been merged in the master branch:
commit 2313c6ad74471aa36c48b8a273ed9cde56a6c256
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Mon May 10 13:16:19 2004 +0000

    Added exifcomment sample program
---
 src/exifcomment.cpp | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 162 insertions(+)

diff --git a/src/exifcomment.cpp b/src/exifcomment.cpp
new file mode 100644
index 0000000..45ed8ab
--- /dev/null
+++ b/src/exifcomment.cpp
@@ -0,0 +1,162 @@
+// ***************************************************************** -*- C++ -*-
+/*
+  Abstract : Sample program showing how to set the Exif comment of an image
+
+  File:      exifcomment.cpp
+  Version  : $Name:  $ $Revision: 1.1 $
+  Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
+  History  : 10-May-04, ahu: created
+ */
+// *****************************************************************************
+// included header files
+#include "exif.hpp"
+#include <iostream>
+#include <iomanip>
+#include <cstring>
+
+// *****************************************************************************
+// local declarations
+
+std::string readError(int rc, const std::string& path);
+std::string writeError(int rc, const std::string& path);
+
+// *****************************************************************************
+// Main
+int main(int argc, char* const argv[])
+try {
+
+    if (argc != 2) {
+        std::cout << "Usage: " << argv[0] << " file
";
+        return 1;
+    }
+
+    Exiv2::ExifData exifData;
+    int rc = exifData.read(argv[1]);
+    if (rc) {
+        std::string error = readError(rc, argv[1]);
+        throw Exiv2::Error(error);
+    }
+
+    /*
+      There are two pitfalls that we need to consider when setting the Exif user
+      comment (Image.UserInfo.UserComment) of an image:
+
+      First, the type of the Exif user comment tag is "undefined" (and not
+      ASCII) according to the Exif standard. This means that in Exiv2, we have
+      to deal with a DataValue (and not an AsciiValue). DataValue has the usual
+      two read methods, however, the one taking a const std::string& buf expects
+      the string to contain a series of integers (e.g., "0 1 2") and not a text
+      string. Thus, we need to use the read function that reads the value from a
+      character buffer of a given length.
+
+      Second, the Exif comment field starts with an eight character area that
+      identifies the used character set. For ASCII, these eight characters are
+      "ASCII

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list