[Python-modules-commits] [sorl-thumbnail] 11/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 0c5988d8ec8beeb59fc7398800b26e8030344f20
Merge: e3edb97 e0d51e3
Author: W. Martin Borgert <debacle at debian.org>
Date: Wed Jan 6 21:18:52 2016 +0100
merge patched into master
debian/.git-dpm | 4 +--
...skip-incompatible-test-for-Django-1.8-1.9.patch | 29 ++++++++++++++++++++++
debian/patches/disable_http_tests.patch | 6 ++---
debian/patches/icc_profile.patch | 2 +-
debian/patches/orientation.patch | 27 +++++++++++++-------
debian/patches/series | 1 +
tests/thumbnail_tests/test_templatetags.py | 10 +++++---
7 files changed, 61 insertions(+), 18 deletions(-)
diff --cc debian/.git-dpm
index 1267f09,0000000..b880952
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
- 9aa9972d0b51cc50de184012ea21ac1b8b69c387
- 9aa9972d0b51cc50de184012ea21ac1b8b69c387
++e0d51e37a53db15ec009bb8b2c3a431fae8fb313
++e0d51e37a53db15ec009bb8b2c3a431fae8fb313
+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/0004-skip-incompatible-test-for-Django-1.8-1.9.patch
index 0000000,0000000..71d2381
new file mode 100644
--- /dev/null
+++ b/debian/patches/0004-skip-incompatible-test-for-Django-1.8-1.9.patch
@@@ -1,0 -1,0 +1,29 @@@
++From e0d51e37a53db15ec009bb8b2c3a431fae8fb313 Mon Sep 17 00:00:00 2001
++From: "W. Martin Borgert" <debacle at debian.org>
++Date: Wed, 6 Jan 2016 21:18:12 +0100
++Subject: skip incompatible test for Django 1.8/1.9
++
++---
++ tests/thumbnail_tests/test_templatetags.py | 2 ++
++ 1 file changed, 2 insertions(+)
++
++diff --git a/tests/thumbnail_tests/test_templatetags.py b/tests/thumbnail_tests/test_templatetags.py
++index 0dbef1e..557c2d2 100644
++--- a/tests/thumbnail_tests/test_templatetags.py
+++++ b/tests/thumbnail_tests/test_templatetags.py
++@@ -8,6 +8,7 @@ from PIL import Image
++
++ from django.template.loader import render_to_string
++ from django.test import Client, TestCase
+++from django import VERSION
++ import pytest
++
++ from sorl.thumbnail.conf import settings
++@@ -167,6 +168,7 @@ class TemplateTestCaseB(BaseTestCase):
++
++
++ class TemplateTestCaseClient(TestCase):
+++ @unittest.skipIf(VERSION[0] == 1 and VERSION[1] in [8, 9], "Test incompatible with Django 1.8/1.9")
++ def test_empty_error(self):
++ with override_custom_settings(settings, THUMBNAIL_DEBUG=False):
++ from django.core.mail import outbox
diff --cc debian/patches/disable_http_tests.patch
index a2860b3,0000000..3579c34
mode 100644,000000..100644
--- a/debian/patches/disable_http_tests.patch
+++ b/debian/patches/disable_http_tests.patch
@@@ -1,58 -1,0 +1,58 @@@
- From fe095e403500827ec3c43591b5ad6f560c4bde41 Mon Sep 17 00:00:00 2001
++From 5ec2035a62b75066218e8af21dc920e413a8a7f2 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/test_engines.py | 13 +++++++------
+ tests/thumbnail_tests/test_templatetags.py | 2 ++
+ 2 files changed, 9 insertions(+), 6 deletions(-)
+
+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(),
+ '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')
+diff --git a/tests/thumbnail_tests/test_templatetags.py b/tests/thumbnail_tests/test_templatetags.py
- index 9281bb3..cc105bd 100644
++index d545519..0dbef1e 100644
+--- a/tests/thumbnail_tests/test_templatetags.py
++++ b/tests/thumbnail_tests/test_templatetags.py
- @@ -144,10 +144,12 @@ class TemplateTestCaseA(BaseTestCase):
++@@ -146,10 +146,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 1e7bef4,0000000..55ac34a
mode 100644,000000..100644
--- a/debian/patches/icc_profile.patch
+++ b/debian/patches/icc_profile.patch
@@@ -1,31 -1,0 +1,31 @@@
- From 9aa9972d0b51cc50de184012ea21ac1b8b69c387 Mon Sep 17 00:00:00 2001
++From 8b292bba76b5fa9f8d2a1da47445d13a1b44284e 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/test_engines.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+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')
+
++ @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 6439336,0000000..10e3766
mode 100644,000000..100644
--- a/debian/patches/orientation.patch
+++ b/debian/patches/orientation.patch
@@@ -1,80 -1,0 +1,89 @@@
- From 084d80afd7d3efd3be6dc2e91b81734525e35b8f Mon Sep 17 00:00:00 2001
++From cb0aedc45be3b391d121e138f43d3d29c1420a2f 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/test_templatetags.py | 37 +++++++++++++++++++++++++++---
- 1 file changed, 34 insertions(+), 3 deletions(-)
++ tests/thumbnail_tests/test_templatetags.py | 39 +++++++++++++++++++++++++++---
++ 1 file changed, 36 insertions(+), 3 deletions(-)
+
+diff --git a/tests/thumbnail_tests/test_templatetags.py b/tests/thumbnail_tests/test_templatetags.py
- index c774dea..9281bb3 100644
++index c774dea..d545519 100644
+--- a/tests/thumbnail_tests/test_templatetags.py
++++ b/tests/thumbnail_tests/test_templatetags.py
- @@ -76,8 +76,10 @@ class TemplateTestCaseA(BaseTestCase):
++@@ -1,6 +1,8 @@
++ # -*- coding: utf-8 -*-
++ import os
++ import re
+++import shutil
+++import unittest
++ from subprocess import Popen, PIPE
++ from PIL import Image
++
++@@ -76,8 +78,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(os.path.join(DATA_DIR, '1_topleft.jpg'))
++ def test_orientation_pixels(self):
- + data_dir = pjoin(settings.MEDIA_ROOT, 'data_pixels')
+++ data_dir = os.path.join(settings.MEDIA_ROOT, 'data_pixels')
++ shutil.copytree(settings.DATA_ROOT, data_dir)
- + ref = Image.open(pjoin(data_dir, '1_topleft.jpg'))
+++ ref = Image.open(os.path.join(data_dir, '1_topleft.jpg'))
+ top = ref.getpixel((14, 7))
+ left = ref.getpixel((7, 14))
+ engine = PILEngine()
- @@ -101,16 +103,45 @@ class TemplateTestCaseA(BaseTestCase):
++@@ -101,16 +105,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')
+ 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')
+++ data_dir = os.path.join(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')
++ im = engine.get_image(th)
+ exif = im._getexif()
+
+ if exif:
+ self.assertEqual(exif.get(0x0112), 1)
+
++ shutil.rmtree(data_dir)
++
+
+ class TemplateTestCaseB(BaseTestCase):
+ def test_url(self):
diff --cc debian/patches/series
index 9f6fd8d,0000000..b7b2fd5
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,3 -1,0 +1,4 @@@
+orientation.patch
+disable_http_tests.patch
+icc_profile.patch
++0004-skip-incompatible-test-for-Django-1.8-1.9.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