[Python-modules-commits] r22797 - in packages/sorl-thumbnail/trunk/debian (4 files)
fladi-guest at users.alioth.debian.org
fladi-guest at users.alioth.debian.org
Fri Oct 19 10:23:36 UTC 2012
Date: Friday, October 19, 2012 @ 10:23:35
Author: fladi-guest
Revision: 22797
Fix orientation tests FTBFS for magick backends (Closes: #678777).
Added:
packages/sorl-thumbnail/trunk/debian/patches/orientation.patch
Modified:
packages/sorl-thumbnail/trunk/debian/changelog
packages/sorl-thumbnail/trunk/debian/control
packages/sorl-thumbnail/trunk/debian/patches/series
Modified: packages/sorl-thumbnail/trunk/debian/changelog
===================================================================
--- packages/sorl-thumbnail/trunk/debian/changelog 2012-10-19 05:47:49 UTC (rev 22796)
+++ packages/sorl-thumbnail/trunk/debian/changelog 2012-10-19 10:23:35 UTC (rev 22797)
@@ -1,3 +1,11 @@
+sorl-thumbnail (11.12-4) UNRELEASED; urgency=low
+
+ * Add patch to fix orientation tests and to skip tests for EXIF
+ orientation if engine does not support it (Closes: #678777).
+ * Bump Standards version to 3.9.3. No changes necessary.
+
+ -- Michael Fladischer <FladischerMichael at fladi.at> Wed, 30 May 2012 10:41:17 +0200
+
sorl-thumbnail (11.12-3) unstable; urgency=low
* Fix syntax warnings in documentation source (Closes: #655610).
Modified: packages/sorl-thumbnail/trunk/debian/control
===================================================================
--- packages/sorl-thumbnail/trunk/debian/control 2012-10-19 05:47:49 UTC (rev 22796)
+++ packages/sorl-thumbnail/trunk/debian/control 2012-10-19 10:23:35 UTC (rev 22797)
@@ -14,7 +14,7 @@
python-pgmagick,
python-setuptools,
python-sphinx (>= 1.0.7+dfsg)
-Standards-Version: 3.9.2
+Standards-Version: 3.9.3
X-Python-Version: >= 2.5
Homepage: https://github.com/sorl/sorl-thumbnail
Vcs-Svn: svn://svn.debian.org/python-modules/packages/sorl-thumbnail/trunk/
Added: packages/sorl-thumbnail/trunk/debian/patches/orientation.patch
===================================================================
--- packages/sorl-thumbnail/trunk/debian/patches/orientation.patch (rev 0)
+++ packages/sorl-thumbnail/trunk/debian/patches/orientation.patch 2012-10-19 10:23:35 UTC (rev 22797)
@@ -0,0 +1,70 @@
+Description: Split orientation test into pixel and EXIF comparison.
+ Skip these tests if graphicsmagick or pgmagick is used as the engine. Both
+ don't synchronize the EXIF orientation with the actual orientation of the
+ image.
+Author: Michael Fladischer <FladischerMichael at fladi.at>
+Last-Update: 2012-10-19
+Forwarded: no
+
+--- a/tests/thumbnail_tests/tests.py
++++ b/tests/thumbnail_tests/tests.py
+@@ -326,8 +326,8 @@
+ m = re.search('Interlace: None', p.stdout.read())
+ self.assertEqual(bool(m), True)
+
+- def test_orientation(self):
+- data_dir = pjoin(settings.MEDIA_ROOT, 'data')
++ def test_orientation_pixels(self):
++ data_dir = pjoin(settings.MEDIA_ROOT, 'data_pixels')
+ shutil.copytree(settings.DATA_ROOT, data_dir)
+ ref = Image.open(pjoin(data_dir, '1_topleft.jpg'))
+ top = ref.getpixel((14, 7))
+@@ -340,15 +340,29 @@
+ y = sum(y) / len(y)
+ return abs(x - y)
+ for name in sorted(os.listdir(data_dir)):
+- th = self.backend.get_thumbnail('data/%s' % name, '30x30')
++ th = self.backend.get_thumbnail('data_pixels/%s' % name, '30x30')
+ im = engine.get_image(th)
+ self.assertLess(epsilon(top, im.getpixel((14, 7))), 10)
+ self.assertLess(epsilon(left, im.getpixel((7, 14))), 10)
++
++ @unittest.skipIf(settings.THUMBNAIL_ENGINE in (
++ "sorl.thumbnail.engines.pgmagick_engine.Engine",
++ "sorl.thumbnail.engines.convert_engine.Engine",
++ ),
++ "graphicsmagick and pgmagick do not correct the orientation in the EXIF tag")
++ def test_orientation_exif(self):
++ data_dir = pjoin(settings.MEDIA_ROOT, 'data_exif')
++ shutil.copytree(settings.DATA_ROOT, data_dir)
++ engine = PILEngine()
++ for name in sorted(os.listdir(data_dir)):
++ th = self.backend.get_thumbnail('data_exif/%s' % name, '30x30')
++ im = engine.get_image(th)
+ exif = im._getexif()
+ if exif:
+ self.assertEqual(exif.get(0x0112), 1)
+
+
++
+ class TemplateTestCaseB(unittest.TestCase):
+ def tearDown(self):
+ try:
+@@ -534,7 +548,7 @@
+ im1 = Item.objects.get(image='100x100.jpg').image
+ im2 = Item.objects.get(image='500x500.jpg').image
+ default.kvstore.get_or_set(ImageFile(im1))
+- # exists in kvstore and in storage
++ # exists in kvstore and in storage
+ self.assertTrue(bool(default.kvstore.get(ImageFile(im1))))
+ self.assertTrue(ImageFile(im1).exists())
+ # delete
+@@ -543,7 +557,7 @@
+ self.assertFalse(ImageFile(im1).exists())
+
+ default.kvstore.get_or_set(ImageFile(im2))
+- # exists in kvstore and in storage
++ # exists in kvstore and in storage
+ self.assertTrue(bool(default.kvstore.get(ImageFile(im2))))
+ self.assertTrue(ImageFile(im2).exists())
+ # delete
Modified: packages/sorl-thumbnail/trunk/debian/patches/series
===================================================================
--- packages/sorl-thumbnail/trunk/debian/patches/series 2012-10-19 05:47:49 UTC (rev 22796)
+++ packages/sorl-thumbnail/trunk/debian/patches/series 2012-10-19 10:23:35 UTC (rev 22797)
@@ -1,2 +1,3 @@
disable_http_tests.patch
fix_sphinx_warnings.patch
+orientation.patch
More information about the Python-modules-commits
mailing list