[pyexiv2/el6: 5/7] Builds in EL-6 and all tests are succesful.

Matej Cepl mcepl at fedoraproject.org
Mon Jan 9 11:46:08 UTC 2012


commit 15f70bba0cba24ebd4660d438e6a7f43b2eac3e4
Author: Matěj Cepl <mcepl at redhat.com>
Date:   Mon Jan 9 12:27:59 2012 +0100

    Builds in EL-6 and all tests are succesful.
    
    Some tests are switched off (relating to iptc_charset property).
    Upstream patch from the upstream maintainer.
    Fixes #753322

 exiv-0-18-2.patch                |  259 --------------------------------------
 pyexiv2-0.3.2-exiv2-0.18.2.patch |   99 +++++++++++++++
 pyexiv2.spec                     |    4 +-
 3 files changed, 101 insertions(+), 261 deletions(-)
---
diff --git a/pyexiv2-0.3.2-exiv2-0.18.2.patch b/pyexiv2-0.3.2-exiv2-0.18.2.patch
new file mode 100644
index 0000000..3c46eaa
--- /dev/null
+++ b/pyexiv2-0.3.2-exiv2-0.18.2.patch
@@ -0,0 +1,99 @@
+=== modified file 'src/exiv2wrapper.cpp'
+--- src/exiv2wrapper.cpp	2011-08-20 10:15:11 +0000
++++ src/exiv2wrapper.cpp	2012-01-09 08:26:28 +0000
+@@ -521,7 +521,7 @@
+ const std::string Image::getIptcCharset() const
+ {
+     CHECK_METADATA_READ
+-    const char* charset = _iptcData->detectCharset();
++    const char* charset = 0;
+     if (charset != 0)
+     {
+         return std::string(charset);
+
+=== modified file 'test/exif.py'
+--- test/exif.py	2011-08-22 16:21:14 +0000
++++ test/exif.py	2012-01-09 07:53:24 +0000
+@@ -192,7 +192,7 @@
+ 
+     def test_convert_to_python_sshort(self):
+         # Valid values
+-        tag = ExifTag('Exif.Image.TimeZoneOffset')
++        tag = ExifTag('Exif.MinoltaCs5D.ColorTemperature')
+         self.assertEqual(tag.type, 'SShort')
+         self.assertEqual(tag._convert_to_python('8'), 8)
+         self.assertEqual(tag._convert_to_python('+5'), 5)
+@@ -206,7 +206,7 @@
+ 
+     def test_convert_to_string_sshort(self):
+         # Valid values
+-        tag = ExifTag('Exif.Image.TimeZoneOffset')
++        tag = ExifTag('Exif.MinoltaCs5D.ColorTemperature')
+         self.assertEqual(tag.type, 'SShort')
+         self.assertEqual(tag._convert_to_string(12), '12')
+         self.assertEqual(tag._convert_to_string(-3), '-3')
+
+=== modified file 'test/metadata.py'
+--- test/metadata.py	2011-08-20 10:38:54 +0000
++++ test/metadata.py	2012-01-09 08:02:13 +0000
+@@ -640,9 +640,9 @@
+         self.clean.read()
+ 
+         self.assertEqual(len(self.clean), 0)
+-        self.assertTrue('Exif.Image.DateTimeOriginal' not in self.clean)
++        self.assertTrue('Exif.Photo.DateTimeOriginal' not in self.clean)
+ 
+-        key = 'Exif.Image.DateTimeOriginal'
++        key = 'Exif.Photo.DateTimeOriginal'
+         correctDate = datetime.datetime(2007,03,11)
+         incorrectDate = datetime.datetime(2009,03,25)
+         tag_date = ExifTag(key,correctDate)
+@@ -650,8 +650,8 @@
+         self.clean[key] = tag_date
+ 
+         self.assertEqual(len(self.clean), 1)
+-        self.assertTrue('Exif.Image.DateTimeOriginal' in self.clean)
+-        self.assertEqual(self.clean.get('Exif.Image.DateTimeOriginal', false_tag_date), tag_date)
++        self.assertTrue('Exif.Photo.DateTimeOriginal' in self.clean)
++        self.assertEqual(self.clean.get('Exif.Photo.DateTimeOriginal', false_tag_date), tag_date)
+         self.assertEqual(self.clean.get('Exif.Image.DateTime', tag_date), tag_date)
+ 
+         key = 'Exif.Photo.UserComment'
+@@ -786,6 +786,7 @@
+     #########################
+ 
+     def test_guess_iptc_charset(self):
++        return
+         # If no charset is defined, exiv2 guesses it from the encoding of the
+         # metadata.
+         self.metadata.read()
+@@ -794,6 +795,7 @@
+         self.assertEqual(self.metadata.iptc_charset, 'utf-8')
+ 
+     def test_set_iptc_charset_utf8(self):
++        return
+         self.metadata.read()
+         self.assert_('Iptc.Envelope.CharacterSet' not in self.metadata.iptc_keys)
+         self.assertEqual(self.metadata.iptc_charset, 'ascii')
+@@ -822,6 +824,7 @@
+                               'iptc_charset', value)
+ 
+     def test_delete_iptc_charset(self):
++        return
+         self.metadata.read()
+         key = 'Iptc.Envelope.CharacterSet'
+ 
+
+=== modified file 'test/pickling.py'
+--- test/pickling.py	2010-12-26 18:30:33 +0000
++++ test/pickling.py	2012-01-09 07:52:58 +0000
+@@ -46,7 +46,7 @@
+         tags.append(ExifTag('Exif.Pentax.Temperature', '14'))
+         tags.append(ExifTag('Exif.Photo.UserComment', 'foo bar baz'))
+         tags.append(ExifTag('Exif.Image.BitsPerSample', 8))
+-        tags.append(ExifTag('Exif.Image.TimeZoneOffset', 7))
++        tags.append(ExifTag('Exif.MinoltaCs5D.ColorTemperature', 7))
+         tags.append(ExifTag('Exif.Image.ImageWidth', 7492))
+         tags.append(ExifTag('Exif.OlympusCs.ManometerReading', 29))
+         tags.append(ExifTag('Exif.Image.XResolution', make_fraction(7, 3)))
+
diff --git a/pyexiv2.spec b/pyexiv2.spec
index c351994..0b709d8 100644
--- a/pyexiv2.spec
+++ b/pyexiv2.spec
@@ -10,7 +10,7 @@ Group:          Development/Languages
 License:        GPLv2+
 URL:            http://tilloy.net/dev/pyexiv2/
 Source0:        http://launchpad.net/pyexiv2/0.3.x/%{version}/+download/pyexiv2-%{version}.tar.bz2
-Patch0:         exiv-0-18-2.patch
+Patch0:         http://tilloy.net/dev/pyexiv2-0.3.2-exiv2-0.18.2.patch
 BuildRequires:  python-devel exiv2-devel boost-devel scons pytz
 
 %description
@@ -21,7 +21,7 @@ embedded in image files (JPEG, TIFF, ...).
 
 %prep
 %setup -q
-%patch0 -p1 -b .exiv2-0182
+%patch0 -p0 -b .exiv2-0182
 
 %build
 # Remove CFLAGS=... for noarch packages (unneeded)


More information about the scm-commits mailing list