[Python-modules-commits] [sorl-thumbnail] 06/17: merge patched into master

Wolfgang Borgert debacle at moszumanska.debian.org
Wed Jan 6 21:05:26 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository sorl-thumbnail.

commit e3edb97e04acc58f3285a57160fee50ecb91869f
Merge: a3ad73c 9aa9972
Author: W. Martin Borgert <debacle at debian.org>
Date:   Fri Jan 1 18:13:58 2016 +0100

    merge patched into master

 .gitignore                                         |   5 +
 .travis.yml                                        | 136 +--
 AUTHORS                                            |   5 +-
 README.rst                                         |  36 +-
 debian/.git-dpm                                    |   6 +-
 debian/patches/disable_http_tests.patch            |  29 +-
 debian/patches/fix_sphinx_warnings.patch           |  41 -
 debian/patches/icc_profile.patch                   |  16 +-
 debian/patches/orientation.patch                   |  28 +-
 debian/patches/series                              |   1 -
 docs/reference/settings.rst                        |   2 +-
 docs/template.rst                                  |   2 +-
 setup.py                                           |   8 +-
 sorl/__init__.py                                   |   6 +-
 sorl/thumbnail/base.py                             |   3 +-
 sorl/thumbnail/compat.py                           |  65 +-
 sorl/thumbnail/engines/base.py                     |  26 +-
 sorl/thumbnail/engines/convert_engine.py           |   9 +-
 sorl/thumbnail/engines/pil_engine.py               |   9 +-
 sorl/thumbnail/engines/wand_engine.py              |  10 +-
 sorl/thumbnail/fields.py                           |   2 +-
 sorl/thumbnail/helpers.py                          |   7 +-
 sorl/thumbnail/images.py                           |  12 +-
 sorl/thumbnail/kvstores/base.py                    |   8 +-
 sorl/thumbnail/kvstores/cached_db_kvstore.py       |  11 +-
 sorl/thumbnail/kvstores/dbm_kvstore.py             |   2 +
 sorl/thumbnail/management/commands/thumbnail.py    |   6 +-
 sorl/thumbnail/migrations/0001_initial.py          |  20 +
 sorl/thumbnail/migrations/__init__.py              |   0
 sorl/thumbnail/templatetags/thumbnail.py           |   2 +-
 tests/runalltests.sh                               |   6 -
 tests/runtests.py                                  |  74 --
 tests/settings/default.py                          |  24 +-
 tests/thumbnail_tests/compat.py                    |   9 +
 .../test_alternative_resolutions.py                |  58 ++
 tests/thumbnail_tests/test_backends.py             | 141 ++++
 tests/thumbnail_tests/test_commands.py             |  68 ++
 tests/thumbnail_tests/test_engines.py              | 369 ++++++++
 tests/thumbnail_tests/test_filters.py              |  48 ++
 tests/thumbnail_tests/test_kvstore.py              |  23 +
 tests/thumbnail_tests/test_parsers.py              |  36 +
 tests/thumbnail_tests/test_storage.py              |  52 ++
 tests/thumbnail_tests/test_templatetags.py         | 179 ++++
 tests/thumbnail_tests/tests.py                     | 931 ---------------------
 tests/thumbnail_tests/urls.py                      |   2 +-
 tests/thumbnail_tests/utils.py                     |  95 ++-
 tox.ini                                            | 389 +--------
 47 files changed, 1419 insertions(+), 1598 deletions(-)

diff --cc debian/.git-dpm
index 08aec42,0000000..1267f09
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,11 -1,0 +1,11 @@@
 +# see git-dpm(1) from git-dpm package
- 8f903b0b3fe0f42f291bbc5c23fc53b0c7508bb9
- 8f903b0b3fe0f42f291bbc5c23fc53b0c7508bb9
- 7c02943347df32aae35213f52a6e80fe6cae2a5a
++9aa9972d0b51cc50de184012ea21ac1b8b69c387
++9aa9972d0b51cc50de184012ea21ac1b8b69c387
++42b81892242e6ae4979e886c38f92a113aa58721
 +42b81892242e6ae4979e886c38f92a113aa58721
 +sorl-thumbnail_12.3.orig.tar.gz
 +a07ff2cde4c0f1735ed3f53dcf79820ab9f56e65
 +527063
 +debianTag="debian/%e%v"
 +patchedTag="patched/%e%v"
 +upstreamTag="upstream/%e%u"
diff --cc debian/patches/disable_http_tests.patch
index 919851f,0000000..a2860b3
mode 100644,000000..100644
--- a/debian/patches/disable_http_tests.patch
+++ b/debian/patches/disable_http_tests.patch
@@@ -1,53 -1,0 +1,58 @@@
- From 26449ec1506399f328f0ecf32f3f873b70d6050b Mon Sep 17 00:00:00 2001
++From fe095e403500827ec3c43591b5ad6f560c4bde41 Mon Sep 17 00:00:00 2001
 +From: Michael Fladischer <FladischerMichael at fladi.at>
 +Date: Thu, 8 Oct 2015 13:53:16 -0700
 +Subject: Disable HTTP requests during build
 +
 + Remote resources such as images fetched over HTTP are not allowed at build
 + time so this patch skips these tests if the environment variable
 + LOCAL_BUILD is present.
 +Last-Update: 2015-01-27
 +Forwarded: not-needed
 +
 +Patch-Name: disable_http_tests.patch
 +---
-  tests/thumbnail_tests/tests.py | 15 +++++++++------
-  1 file changed, 9 insertions(+), 6 deletions(-)
++ tests/thumbnail_tests/test_engines.py      | 13 +++++++------
++ tests/thumbnail_tests/test_templatetags.py |  2 ++
++ 2 files changed, 9 insertions(+), 6 deletions(-)
 +
- diff --git a/tests/thumbnail_tests/tests.py b/tests/thumbnail_tests/tests.py
- index 0959e27..67dc16d 100644
- --- a/tests/thumbnail_tests/tests.py
- +++ b/tests/thumbnail_tests/tests.py
- @@ -363,12 +363,13 @@ class SimpleTestCase(SimpleTestCaseBase):
++diff --git a/tests/thumbnail_tests/test_engines.py b/tests/thumbnail_tests/test_engines.py
++index 3b60b33..6bc0e82 100644
++--- a/tests/thumbnail_tests/test_engines.py
+++++ b/tests/thumbnail_tests/test_engines.py
++@@ -190,12 +190,13 @@ class SimpleTestCase(BaseTestCase):
 +             default.kvstore.get(im).serialize_storage(),
-              'thumbnail_tests.storage.TestStorage',
++             'tests.thumbnail_tests.storage.TestStorage',
 +         )
 +-        im = ImageFile('http://dummyimage.com/300x300/')
 +-        default.kvstore.set(im)
 +-        self.assertEqual(
 +-            default.kvstore.get(im).serialize_storage(),
 +-            'sorl.thumbnail.images.UrlStorage',
 +-        )
 ++        if not os.environ.get('LOCAL_BUILD', False):
 ++            im = ImageFile('http://dummyimage.com/300x300/')
 ++            default.kvstore.set(im)
 ++            self.assertEqual(
 ++                default.kvstore.get(im).serialize_storage(),
 ++                'sorl.thumbnail.images.UrlStorage',
 ++            )
 + 
 +     def test_abspath(self):
 +         item = Item.objects.get(image='500x500.jpg')
- @@ -577,10 +578,12 @@ class TemplateTestCaseB(unittest.TestCase):
-          except Exception:
-              pass
++diff --git a/tests/thumbnail_tests/test_templatetags.py b/tests/thumbnail_tests/test_templatetags.py
++index 9281bb3..cc105bd 100644
++--- a/tests/thumbnail_tests/test_templatetags.py
+++++ b/tests/thumbnail_tests/test_templatetags.py
++@@ -144,10 +144,12 @@ class TemplateTestCaseA(BaseTestCase):
 + 
++ 
++ class TemplateTestCaseB(BaseTestCase):
 ++    @unittest.skipIf(os.environ.get('LOCAL_BUILD', False), "No remote resources desired")
 +     def test_url(self):
 +         val = render_to_string('thumbnail3.html', {}).strip()
 +         self.assertEqual(val, '<img style="margin:0px 0px 0px 0px" width="20" height="20">')
 + 
 ++    @unittest.skipIf(os.environ.get('LOCAL_BUILD', False), "No remote resources desired")
 +     def test_portrait(self):
 +         val = render_to_string('thumbnail4.html', {
 +             'source': 'http://dummyimage.com/120x100/',
diff --cc debian/patches/icc_profile.patch
index 3f0121b,0000000..1e7bef4
mode 100644,000000..100644
--- a/debian/patches/icc_profile.patch
+++ b/debian/patches/icc_profile.patch
@@@ -1,31 -1,0 +1,31 @@@
- From 2e4c2ff73cdb90460bf1d7ca057a67f5f2070925 Mon Sep 17 00:00:00 2001
++From 9aa9972d0b51cc50de184012ea21ac1b8b69c387 Mon Sep 17 00:00:00 2001
 +From: Michael Fladischer <FladischerMichael at fladi.at>
 +Date: Thu, 8 Oct 2015 13:53:18 -0700
 +Subject: isome engines do not preserve ICC profile on crop
 +
 + Skip the test for the ICC profile in a thumbnail if either graphicsmagick or
 + pgmagick is used as an engine.
 +Last-Update: 2015-01-27
 +Forwarded: no
 +
 +Patch-Name: icc_profile.patch
 +---
-  tests/thumbnail_tests/tests.py | 5 +++++
++ tests/thumbnail_tests/test_engines.py | 5 +++++
 + 1 file changed, 5 insertions(+)
 +
- diff --git a/tests/thumbnail_tests/tests.py b/tests/thumbnail_tests/tests.py
- index 67dc16d..56773ae 100644
- --- a/tests/thumbnail_tests/tests.py
- +++ b/tests/thumbnail_tests/tests.py
- @@ -709,6 +709,11 @@ class CropTestCase(SimpleTestCaseBase):
++diff --git a/tests/thumbnail_tests/test_engines.py b/tests/thumbnail_tests/test_engines.py
++index 6bc0e82..082a331 100644
++--- a/tests/thumbnail_tests/test_engines.py
+++++ b/tests/thumbnail_tests/test_engines.py
++@@ -329,6 +329,11 @@ class CropTestCase(BaseTestCase):
 +         # TODO: Complete test for smart crop
-          self.backend.get_thumbnail('32x32', 'data/white_border.jpg', crop='smart')
++         self.BACKEND.get_thumbnail('32x32', 'data/white_border.jpg', crop='smart')
 + 
 ++    @unittest.skipIf(settings.THUMBNAIL_ENGINE in (
 ++        "sorl.thumbnail.engines.pgmagick_engine.Engine",
 ++        "sorl.thumbnail.engines.convert_engine.Engine",
 ++        ),
 ++        "graphicsmagick and pgmagick do not preserve ICC profile on crop")
 +     def test_crop_image_with_icc_profile(self):
 +         name = 'data/icc_profile_test.jpg'
 +         item, _ = Item.objects.get_or_create(image=name)
diff --cc debian/patches/orientation.patch
index ea8f63c,0000000..6439336
mode 100644,000000..100644
--- a/debian/patches/orientation.patch
+++ b/debian/patches/orientation.patch
@@@ -1,80 -1,0 +1,80 @@@
- From 1d7dade241679153ad46ec7fc56297901ca112e8 Mon Sep 17 00:00:00 2001
++From 084d80afd7d3efd3be6dc2e91b81734525e35b8f Mon Sep 17 00:00:00 2001
 +From: Michael Fladischer <FladischerMichael at fladi.at>
 +Date: Thu, 8 Oct 2015 13:53:15 -0700
 +Subject: 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.
 +Last-Update: 2015-01-27
 +Forwarded: no
 +
 +Patch-Name: orientation.patch
 +---
-  tests/thumbnail_tests/tests.py | 37 ++++++++++++++++++++++++++++++++++---
++ tests/thumbnail_tests/test_templatetags.py | 37 +++++++++++++++++++++++++++---
 + 1 file changed, 34 insertions(+), 3 deletions(-)
 +
- diff --git a/tests/thumbnail_tests/tests.py b/tests/thumbnail_tests/tests.py
- index a5332b2..0959e27 100644
- --- a/tests/thumbnail_tests/tests.py
- +++ b/tests/thumbnail_tests/tests.py
- @@ -503,8 +503,10 @@ class TemplateTestCaseA(SimpleTestCaseBase):
++diff --git a/tests/thumbnail_tests/test_templatetags.py b/tests/thumbnail_tests/test_templatetags.py
++index c774dea..9281bb3 100644
++--- a/tests/thumbnail_tests/test_templatetags.py
+++++ b/tests/thumbnail_tests/test_templatetags.py
++@@ -76,8 +76,10 @@ class TemplateTestCaseA(BaseTestCase):
 +         m = re.search('Interlace: None', str(p.stdout.read()))
 +         self.assertEqual(bool(m), True)
 + 
 +-    def test_orientation(self):
- -        ref = Image.open(pjoin(DATA_DIR, '1_topleft.jpg'))
++-        ref = Image.open(os.path.join(DATA_DIR, '1_topleft.jpg'))
 ++    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))
 +         left = ref.getpixel((7, 14))
 +         engine = PILEngine()
- @@ -528,16 +530,45 @@ class TemplateTestCaseA(SimpleTestCaseBase):
++@@ -101,16 +103,45 @@ class TemplateTestCaseA(BaseTestCase):
 +         )
 + 
 +         for name in data_images:
- -            th = self.backend.get_thumbnail('data/%s' % name, '30x30')
- +            th = self.backend.get_thumbnail('data_pixels/%s' % name, '30x30')
++-            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)
 ++
 ++        shutil.rmtree(data_dir)
 ++
 ++    @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()
 ++
 ++        data_images = (
 ++            '1_topleft.jpg',
 ++            '2_topright.jpg',
 ++            '3_bottomright.jpg',
 ++            '4_bottomleft.jpg',
 ++            '5_lefttop.jpg',
 ++            '6_righttop.jpg',
 ++            '7_rightbottom.jpg',
 ++            '8_leftbottom.jpg'
 ++        )
 ++
 ++        for name in sorted(os.listdir(data_dir)):
- +            th = self.backend.get_thumbnail('data_exif/%s' % name, '30x30')
+++            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)
 + 
 ++        shutil.rmtree(data_dir)
 ++
 + 
-  class TemplateTestCaseB(unittest.TestCase):
-      def tearDown(self):
++ class TemplateTestCaseB(BaseTestCase):
++     def test_url(self):
diff --cc debian/patches/series
index f313894,0000000..9f6fd8d
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,4 -1,0 +1,3 @@@
 +orientation.patch
 +disable_http_tests.patch
 +icc_profile.patch
- fix_sphinx_warnings.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sorl-thumbnail.git



More information about the Python-modules-commits mailing list