You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/05/20 19:26:26 UTC

[1/2] git commit: [#6255] change to work with either PIL or Pillow

Updated Branches:
  refs/heads/db/6255 [created] 2ef1046cc


[#6255] change to work with either PIL or Pillow


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/d9c9269f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d9c9269f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d9c9269f

Branch: refs/heads/db/6255
Commit: d9c9269ff53fa424b8a94a327f638dae48d364be
Parents: 05d660d
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon May 20 17:26:07 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon May 20 17:26:07 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/filesystem.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d9c9269f/Allura/allura/model/filesystem.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/filesystem.py b/Allura/allura/model/filesystem.py
index 41a64ab..c56e595 100644
--- a/Allura/allura/model/filesystem.py
+++ b/Allura/allura/model/filesystem.py
@@ -20,7 +20,7 @@ from cStringIO import StringIO
 import logging
 
 import pylons
-import Image
+import PIL
 from gridfs import GridFS
 from tg import config
 from paste.deploy.converters import asint
@@ -136,9 +136,9 @@ class File(MappedClass):
         if square and height != width:
             sz = max(width, height)
             if 'transparency' in image.info:
-                new_image = Image.new('RGBA', (sz,sz))
+                new_image = PIL.Image.new('RGBA', (sz,sz))
             else:
-                new_image = Image.new('RGB', (sz,sz), 'white')
+                new_image = PIL.Image.new('RGB', (sz,sz), 'white')
             if height < width:
                 # image is wider than tall, so center horizontally
                 new_image.paste(image, ((width-height)/2, 0))
@@ -148,7 +148,7 @@ class File(MappedClass):
             image = new_image
 
         if thumbnail_size:
-            image.thumbnail(thumbnail_size, Image.ANTIALIAS)
+            image.thumbnail(thumbnail_size, PIL.Image.ANTIALIAS)
 
         thumbnail_meta = thumbnail_meta or {}
         thumbnail = cls(
@@ -175,9 +175,9 @@ class File(MappedClass):
             return None, None
 
         try:
-            image = Image.open(fp)
+            image = PIL.Image.open(fp)
         except IOError as e:
-            log.error('Error opening image %s %s', filename, e)
+            log.error('Error opening image %s %s', filename, e, exc_info=True)
             return None, None
 
         format = image.format


[2/2] git commit: [#6255] switch dependencies from PIL to Pillow

Posted by br...@apache.org.
[#6255] switch dependencies from PIL to Pillow


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/2ef1046c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2ef1046c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2ef1046c

Branch: refs/heads/db/6255
Commit: 2ef1046cc471a3e23ef89768d6cb0229d40bf723
Parents: d9c9269
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon May 20 17:26:20 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon May 20 17:26:20 2013 +0000

----------------------------------------------------------------------
 Allura/setup.py |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2ef1046c/Allura/setup.py
----------------------------------------------------------------------
diff --git a/Allura/setup.py b/Allura/setup.py
index 5866792..7aa1e74 100644
--- a/Allura/setup.py
+++ b/Allura/setup.py
@@ -68,7 +68,6 @@ setup(
         "Pygments >= 1.1.1",
         "python-openid >= 2.2.4",
         "EasyWidgets >= 0.1.1",
-        "PIL >= 1.1.7",
         "iso8601",
         "chardet >= 1.0.1",
         "feedparser >= 5.0.1",