[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:05 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=3c952a6
The following commit has been merged in the master branch:
commit 3c952a69938774fc81adfa1489393cc1d4dd8da9
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Mon Feb 16 09:04:51 2004 +0000
Simplifed the example
---
src/example1.cpp | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/src/example1.cpp b/src/example1.cpp
index 47cf6f4..7d41350 100644
--- a/src/example1.cpp
+++ b/src/example1.cpp
@@ -3,7 +3,7 @@
Abstract: Example showing how to add, modify and delete Exif metadata
File: example1.cpp
- Version: $Name: $ $Revision: 1.3 $
+ Version: $Name: $ $Revision: 1.4 $
Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
History: 26-Jan-04, ahu: created
*/
@@ -42,22 +42,19 @@ try {
delete v;
// Now create a more interesting value
- v = Exif::Value::create(Exif::unsignedRational);
+ Exif::URationalValue* rv = new Exif::URationalValue;
// Set two rational components from a string
- v->read("1/2 1/3");
- // Downcast the Value to its actual type
- Exif::URationalValue* rv = dynamic_cast<Exif::URationalValue*>(v);
- if (rv == 0) throw Exif::Error("Downcast failed");
- // Add more elements through the extended interface of the actual type
+ rv->read("1/2 1/3");
+ // Add more elements through the extended interface of rational value
rv->value_.push_back(std::make_pair(2,3));
rv->value_.push_back(std::make_pair(3,4));
// Add the key and value pair to the Exif data
key = "Image.ImageCharacteristics.PrimaryChromaticities";
exifData.add(key, rv);
- std::cout << "Added key \"" << key << "\", value \"" << *v << "\"
";
- // Delete the memory allocated by Value::create
- delete v;
+ std::cout << "Added key \"" << key << "\", value \"" << *rv << "\"
";
+ // Delete memory allocated on the heap
+ delete rv;
// *************************************************************************
// Modify Exif data
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list