Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 289004 | Differences between
and this patch

Collapse All | Expand All

(-)src/libpyexiv2.cpp (-2 / +29 lines)
Lines 33-38 Link Here
33
#define THUMB_ACCESS 104
33
#define THUMB_ACCESS 104
34
#define NO_THUMBNAIL 105
34
#define NO_THUMBNAIL 105
35
35
36
37
// Copied from libexiv2's src/iptc.cpp.
38
// Was previously called Exiv2::FindMetadatumById::FindMetadatumById but it was
39
// renamed and moved in revision 1727. See http://dev.exiv2.org/issues/show/581.
40
//! Unary predicate that matches an Iptcdatum with given record and dataset
41
class FindIptcdatum {
42
public:
43
    //! Constructor, initializes the object with the record and dataset id
44
    FindIptcdatum(uint16_t dataset, uint16_t record)
45
        : dataset_(dataset), record_(record) {}
46
    /*!
47
      @brief Returns true if the record and dataset id of the argument
48
            Iptcdatum is equal to that of the object.
49
    */
50
    bool operator()(const Exiv2::Iptcdatum& iptcdatum) const
51
    {
52
        return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
53
    }
54
55
private:
56
    // DATA
57
    uint16_t dataset_;
58
    uint16_t record_;
59
60
}; // class FindIptcdatum
61
62
36
namespace LibPyExiv2
63
namespace LibPyExiv2
37
{
64
{
38
65
Lines 228-234 Link Here
228
			while ((indexCounter > 0) && (dataIterator != _iptcData.end()))
255
			while ((indexCounter > 0) && (dataIterator != _iptcData.end()))
229
			{
256
			{
230
				dataIterator = std::find_if(++dataIterator, _iptcData.end(),
257
				dataIterator = std::find_if(++dataIterator, _iptcData.end(),
231
					Exiv2::FindMetadatumById::FindMetadatumById(iptcKey.tag(), iptcKey.record()));
258
					FindIptcdatum(iptcKey.tag(), iptcKey.record()));
232
				--indexCounter;
259
				--indexCounter;
233
			}
260
			}
234
			if (dataIterator != _iptcData.end())
261
			if (dataIterator != _iptcData.end())
Lines 266-272 Link Here
266
			while ((indexCounter > 0) && (dataIterator != _iptcData.end()))
293
			while ((indexCounter > 0) && (dataIterator != _iptcData.end()))
267
			{
294
			{
268
				dataIterator = std::find_if(++dataIterator, _iptcData.end(),
295
				dataIterator = std::find_if(++dataIterator, _iptcData.end(),
269
					Exiv2::FindMetadatumById::FindMetadatumById(iptcKey.tag(), iptcKey.record()));
296
					FindIptcdatum(iptcKey.tag(), iptcKey.record()));
270
				--indexCounter;
297
				--indexCounter;
271
			}
298
			}
272
			if (dataIterator != _iptcData.end())
299
			if (dataIterator != _iptcData.end())
(-)unittest/Bug183618_TestCase.py (-2 / +2 lines)
Lines 71-82 Link Here
71
71
72
        # Exhaustive tests on the values of EXIF GPS metadata
72
        # Exhaustive tests on the values of EXIF GPS metadata
73
        gpsTags = [('Exif.Image.GPSTag', long, 1313L),
73
        gpsTags = [('Exif.Image.GPSTag', long, 1313L),
74
                   ('Exif.GPSInfo.GPSVersionID', str, '2 0 0 0 '),
74
                   ('Exif.GPSInfo.GPSVersionID', str, '2 0 0 0'),
75
                   ('Exif.GPSInfo.GPSLatitudeRef', str, 'N'),
75
                   ('Exif.GPSInfo.GPSLatitudeRef', str, 'N'),
76
                   ('Exif.GPSInfo.GPSLatitude', tuple, (pyexiv2.Rational(47, 1), pyexiv2.Rational(3817443, 1000000), pyexiv2.Rational(0, 1))),
76
                   ('Exif.GPSInfo.GPSLatitude', tuple, (pyexiv2.Rational(47, 1), pyexiv2.Rational(3817443, 1000000), pyexiv2.Rational(0, 1))),
77
                   ('Exif.GPSInfo.GPSLongitudeRef', str, 'E'),
77
                   ('Exif.GPSInfo.GPSLongitudeRef', str, 'E'),
78
                   ('Exif.GPSInfo.GPSLongitude', tuple, (pyexiv2.Rational(8, 1), pyexiv2.Rational(41359940, 1000000), pyexiv2.Rational(0, 1))),
78
                   ('Exif.GPSInfo.GPSLongitude', tuple, (pyexiv2.Rational(8, 1), pyexiv2.Rational(41359940, 1000000), pyexiv2.Rational(0, 1))),
79
                   ('Exif.GPSInfo.GPSAltitudeRef', str, '0 '),
79
                   ('Exif.GPSInfo.GPSAltitudeRef', str, '0'),
80
                   ('Exif.GPSInfo.GPSAltitude', pyexiv2.Rational, pyexiv2.Rational(1908629, 1250)),
80
                   ('Exif.GPSInfo.GPSAltitude', pyexiv2.Rational, pyexiv2.Rational(1908629, 1250)),
81
                   ('Exif.GPSInfo.GPSMapDatum', str, 'WGS-84')]
81
                   ('Exif.GPSInfo.GPSMapDatum', str, 'WGS-84')]
82
        self.assertEqual([tag for tag in image.exifKeys() if tag.find('GPS') != -1], [tag[0] for tag in gpsTags])
82
        self.assertEqual([tag for tag in image.exifKeys() if tag.find('GPS') != -1], [tag[0] for tag in gpsTags])

Return to bug 289004