[Python-modules-commits] r31695 - in packages/sorl-thumbnail/trunk/debian/patches (5 files)

fladi-guest at users.alioth.debian.org fladi-guest at users.alioth.debian.org
Tue Jan 27 10:06:48 UTC 2015


    Date: Tuesday, January 27, 2015 @ 10:06:47
  Author: fladi-guest
Revision: 31695

Add icc_profile.patch and renew existing patches.

Added:
  packages/sorl-thumbnail/trunk/debian/patches/icc_profile.patch
Modified:
  packages/sorl-thumbnail/trunk/debian/patches/disable_http_tests.patch
  packages/sorl-thumbnail/trunk/debian/patches/fix_sphinx_warnings.patch
  packages/sorl-thumbnail/trunk/debian/patches/orientation.patch
  packages/sorl-thumbnail/trunk/debian/patches/series

Modified: packages/sorl-thumbnail/trunk/debian/patches/disable_http_tests.patch
===================================================================
--- packages/sorl-thumbnail/trunk/debian/patches/disable_http_tests.patch	2015-01-27 09:35:57 UTC (rev 31694)
+++ packages/sorl-thumbnail/trunk/debian/patches/disable_http_tests.patch	2015-01-27 10:06:47 UTC (rev 31695)
@@ -1,43 +1,43 @@
 Description: 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 
+ 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.
 Author: Michael Fladischer <FladischerMichael at fladi.at>
-Last-Update: 2012-01-12
+Last-Update: 2015-01-27
 Forwarded: not-needed
 
 --- a/tests/thumbnail_tests/tests.py
 +++ b/tests/thumbnail_tests/tests.py
-@@ -241,12 +241,13 @@
+@@ -363,12 +363,13 @@
              default.kvstore.get(im).serialize_storage(),
              'thumbnail_tests.storage.TestStorage',
-             )
--        im = ImageFile('http://www.aino.se/media/i/logo.png')
+         )
+-        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://www.aino.se/media/i/logo.png')
++            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')
-@@ -355,10 +356,12 @@
+@@ -577,10 +578,12 @@
          except Exception:
              pass
  
 +    @unittest.skipIf(os.environ.get('LOCAL_BUILD', False), "No remote resources desired")
-     def testUrl(self):
+     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 testPortrait(self):
+     def test_portrait(self):
          val = render_to_string('thumbnail4.html', {
-             'source': 'http://www.aino.se/media/i/logo.png',
+             'source': 'http://dummyimage.com/120x100/',

Modified: packages/sorl-thumbnail/trunk/debian/patches/fix_sphinx_warnings.patch
===================================================================
--- packages/sorl-thumbnail/trunk/debian/patches/fix_sphinx_warnings.patch	2015-01-27 09:35:57 UTC (rev 31694)
+++ packages/sorl-thumbnail/trunk/debian/patches/fix_sphinx_warnings.patch	2015-01-27 10:06:47 UTC (rev 31695)
@@ -2,28 +2,30 @@
  Ther are two minoir typos in upstream documentation that lead to sphinx 
  emitting warnings during build. This patch fixes both.
 Author: Michael Fladischer <FladischerMichael at fladi.at>
-Last-Update: 2012-01-13
-Forwarded: https://github.com/sorl/sorl-thumbnail/pull/80
+Last-Update: 2015-01-26
+Forwarded: no
 
---- a/docs/reference/settings.rst
-+++ b/docs/reference/settings.rst
-@@ -119,7 +119,7 @@
+--- a/docs/management.rst
++++ b/docs/management.rst
+@@ -32,7 +32,7 @@
+ .. _thumbnail-clear-delete-referenced:
  
+ thumbnail clear_delete_referenced
+-===============
++=================================
+ ``python manage.py thumbnail clear_delete_referenced``
  
- ``THUMBNAIL_IDENTIFY``
--=====================
-+======================
+ Equivalent to to ``clear`` but first it will delete all thumbnail files
+@@ -42,10 +42,10 @@
+ all the thumbnails the Key Value Store knows about.
  
- - Default ``'identify'``
  
---- a/docs/management.rst
-+++ b/docs/management.rst
-@@ -22,7 +22,7 @@
- ``python manage.py thumbnail clear``
+-.. _thumbnail-clear:
++.. _thumbnail-clear-delete-all:
  
- This totally empties the Key Value Store from all keys that start with the
--:ref:`THUMBNAIL_KEY_PREFIX`. It does not delete any files. It is generally safe to
-+:ref:``THUMBNAIL_KEY_PREFIX``. It does not delete any files. It is generally safe to
- run this if you do not reference the generated thumbnails by name somewhere
- else in your code. The Key Value store will update when you hit the template
- tags, and if the thumbnails still exist they will be used and not overwritten.
+ thumbnail clear_delete_all
+-===============
++==========================
+ ``python manage.py thumbnail clear_delete_all``
+ 
+ Equivalent to to ``clear`` but afterwards it will delete all thumbnail files

Added: packages/sorl-thumbnail/trunk/debian/patches/icc_profile.patch
===================================================================
--- packages/sorl-thumbnail/trunk/debian/patches/icc_profile.patch	                        (rev 0)
+++ packages/sorl-thumbnail/trunk/debian/patches/icc_profile.patch	2015-01-27 10:06:47 UTC (rev 31695)
@@ -0,0 +1,21 @@
+Description: 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.
+Author: Michael Fladischer <FladischerMichael at fladi.at>
+Last-Update: 2015-01-27
+Forwarded: no
+
+--- a/tests/thumbnail_tests/tests.py
++++ b/tests/thumbnail_tests/tests.py
+@@ -709,6 +709,11 @@
+         # 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)

Modified: packages/sorl-thumbnail/trunk/debian/patches/orientation.patch
===================================================================
--- packages/sorl-thumbnail/trunk/debian/patches/orientation.patch	2015-01-27 09:35:57 UTC (rev 31694)
+++ packages/sorl-thumbnail/trunk/debian/patches/orientation.patch	2015-01-27 10:06:47 UTC (rev 31695)
@@ -3,68 +3,68 @@
  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
+Last-Update: 2015-01-27
 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())
+@@ -503,8 +503,10 @@
+         m = re.search('Interlace: None', str(p.stdout.read()))
          self.assertEqual(bool(m), True)
  
 -    def test_orientation(self):
--        data_dir = pjoin(settings.MEDIA_ROOT, 'data')
+-        ref = Image.open(pjoin(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'))
++        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)):
+         left = ref.getpixel((7, 14))
+         engine = PILEngine()
+@@ -528,16 +530,45 @@
+         )
+ 
+         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")
++        "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')
 +            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):
-         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	2015-01-27 09:35:57 UTC (rev 31694)
+++ packages/sorl-thumbnail/trunk/debian/patches/series	2015-01-27 10:06:47 UTC (rev 31695)
@@ -1,4 +1,4 @@
+orientation.patch
 disable_http_tests.patch
+icc_profile.patch
 fix_sphinx_warnings.patch
-orientation.patch
-django1.6.patch




More information about the Python-modules-commits mailing list