f4833d6
=== modified file 'src/libpyexiv2.cpp'
f4833d6
--- src/libpyexiv2.cpp	2009-03-14 21:43:49 +0000
f4833d6
+++ src/libpyexiv2.cpp	2010-01-05 08:04:49 +0000
f4833d6
@@ -33,6 +33,33 @@
f4833d6
 #define THUMB_ACCESS 104
f4833d6
 #define NO_THUMBNAIL 105
f4833d6
 
f4833d6
+
f4833d6
+// Copied from libexiv2's src/iptc.cpp.
f4833d6
+// Was previously called Exiv2::FindMetadatumById::FindMetadatumById but it was
f4833d6
+// renamed and moved in revision 1727. See http://dev.exiv2.org/issues/show/581.
f4833d6
+//! Unary predicate that matches an Iptcdatum with given record and dataset
f4833d6
+class FindIptcdatum {
f4833d6
+public:
f4833d6
+    //! Constructor, initializes the object with the record and dataset id
f4833d6
+    FindIptcdatum(uint16_t dataset, uint16_t record)
f4833d6
+        : dataset_(dataset), record_(record) {}
f4833d6
+    /*!
f4833d6
+      @brief Returns true if the record and dataset id of the argument
f4833d6
+            Iptcdatum is equal to that of the object.
f4833d6
+    */
f4833d6
+    bool operator()(const Exiv2::Iptcdatum& iptcdatum) const
f4833d6
+    {
f4833d6
+        return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
f4833d6
+    }
f4833d6
+
f4833d6
+private:
f4833d6
+    // DATA
f4833d6
+    uint16_t dataset_;
f4833d6
+    uint16_t record_;
f4833d6
+
f4833d6
+}; // class FindIptcdatum
f4833d6
+
f4833d6
+
f4833d6
 namespace LibPyExiv2
f4833d6
 {
f4833d6
 
f4833d6
@@ -228,7 +255,7 @@
f4833d6
 			while ((indexCounter > 0) && (dataIterator != _iptcData.end()))
f4833d6
 			{
f4833d6
 				dataIterator = std::find_if(++dataIterator, _iptcData.end(),
f4833d6
-					Exiv2::FindMetadatumById::FindMetadatumById(iptcKey.tag(), iptcKey.record()));
f4833d6
+					FindIptcdatum(iptcKey.tag(), iptcKey.record()));
f4833d6
 				--indexCounter;
f4833d6
 			}
f4833d6
 			if (dataIterator != _iptcData.end())
f4833d6
@@ -266,7 +293,7 @@
f4833d6
 			while ((indexCounter > 0) && (dataIterator != _iptcData.end()))
f4833d6
 			{
f4833d6
 				dataIterator = std::find_if(++dataIterator, _iptcData.end(),
f4833d6
-					Exiv2::FindMetadatumById::FindMetadatumById(iptcKey.tag(), iptcKey.record()));
f4833d6
+					FindIptcdatum(iptcKey.tag(), iptcKey.record()));
f4833d6
 				--indexCounter;
f4833d6
 			}
f4833d6
 			if (dataIterator != _iptcData.end())
f4833d6
f4833d6
=== modified file 'unittest/Bug183618_TestCase.py'
f4833d6
--- unittest/Bug183618_TestCase.py	2008-02-09 01:13:28 +0000
f4833d6
+++ unittest/Bug183618_TestCase.py	2010-01-05 08:06:59 +0000
f4833d6
@@ -71,12 +71,12 @@
f4833d6
 
f4833d6
         # Exhaustive tests on the values of EXIF GPS metadata
f4833d6
         gpsTags = [('Exif.Image.GPSTag', long, 1313L),
f4833d6
-                   ('Exif.GPSInfo.GPSVersionID', str, '2 0 0 0 '),
f4833d6
+                   ('Exif.GPSInfo.GPSVersionID', str, '2 0 0 0'),
f4833d6
                    ('Exif.GPSInfo.GPSLatitudeRef', str, 'N'),
f4833d6
                    ('Exif.GPSInfo.GPSLatitude', tuple, (pyexiv2.Rational(47, 1), pyexiv2.Rational(3817443, 1000000), pyexiv2.Rational(0, 1))),
f4833d6
                    ('Exif.GPSInfo.GPSLongitudeRef', str, 'E'),
f4833d6
                    ('Exif.GPSInfo.GPSLongitude', tuple, (pyexiv2.Rational(8, 1), pyexiv2.Rational(41359940, 1000000), pyexiv2.Rational(0, 1))),
f4833d6
-                   ('Exif.GPSInfo.GPSAltitudeRef', str, '0 '),
f4833d6
+                   ('Exif.GPSInfo.GPSAltitudeRef', str, '0'),
f4833d6
                    ('Exif.GPSInfo.GPSAltitude', pyexiv2.Rational, pyexiv2.Rational(1908629, 1250)),
f4833d6
                    ('Exif.GPSInfo.GPSMapDatum', str, 'WGS-84')]
f4833d6
         self.assertEqual([tag for tag in image.exifKeys() if tag.find('GPS') != -1], [tag[0] for tag in gpsTags])
f4833d6