Skip to content

Commit

Permalink
Upgrade Pillow and Tornado
Browse files Browse the repository at this point in the history
  • Loading branch information
agschwender committed Apr 20, 2017
1 parent 4d608d2 commit c93f990
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ before_install:
- sudo apt-get install python-numpy python-opencv python-pycurl
install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
- pip install tornado==4.0.2 Pillow==2.8.1 coveralls
- pip install tornado==4.5.1 Pillow==2.9.0 coveralls
- pip install pep8==1.6.2 pyflakes==0.8.1
before_script:
- pep8 --exclude=test pilbox
Expand Down
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@
* 1.2.1: Added max operations config property
* 1.2.2: Added max resize width and height config properties
* 1.2.3: Added user_agent option
* 1.3.0: Increased Pillow to 4.1.0 and Tornado to 4.5.1
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Setup
Dependencies
------------

- >= `Python 2.7 <http://www.python.org/download/>`_
- `Pillow 2.8.1 <https://pypi.python.org/pypi/Pillow/2.8.1>`_
- `Tornado 4.0.2 <https://pypi.python.org/pypi/tornado/4.0.2>`_
- `Python >= 2.7 <http://www.python.org/download/>`_
- `Pillow 4.1.0 <https://pypi.python.org/pypi/Pillow/4.1.0>`_
- `Tornado 2.9.0 <https://pypi.python.org/pypi/tornado/2.9.0>`_
- `OpenCV 2.x <http://opencv.org/>`_ (optional)
- `PycURL 7.x <http://pycurl.sourceforge.net/>`_ (optional, but
recommended; required for proxy requests and requests over TLS)
Expand Down Expand Up @@ -631,3 +631,4 @@ Changelog
- 1.2.1: Added max operations config property
- 1.2.2: Added max resize width and height config properties
- 1.2.3: Added user_agent option
- 1.3.0: Increased Pillow to 2.9.0 and Tornado to 4.5.1
5 changes: 3 additions & 2 deletions pilbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,14 @@
* 1.2.1: Added max operations config property
* 1.2.2: Added max resize width and height config properties
* 1.2.3: Added user_agent option
* 1.3.0: Increased Pillow to 2.9.0 and Tornado to 4.5.1
"""

# human-readable version number
version = "1.2.3"
version = "1.3.0"

# The first three numbers are the components of the version number.
# The fourth is zero for an official release, positive for a development
# branch, or negative for a release candidate or beta (after the base version
# number has been incremented)
version_info = (1, 2, 3, 0)
version_info = (1, 3, 0, 0)
15 changes: 12 additions & 3 deletions pilbox/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,17 @@ def rotate(self, deg, **kwargs):
else:
deg = 0

expand = False if int(deg) % 90 == 0 else bool(int(opts["expand"]))
self.img = self.img.rotate(360 - int(deg), expand=expand)
deg = 360 - (int(deg) % 360)
if deg % 90 == 0:
if deg == 90:
self.img = self.img.transpose(PIL.Image.ROTATE_90)
elif deg == 180:
self.img = self.img.transpose(PIL.Image.ROTATE_180)
elif deg == 270:
self.img = self.img.transpose(PIL.Image.ROTATE_270)
else:
self.img = self.img.rotate(deg, expand=bool(int(opts["expand"])))

return self

def save(self, **kwargs):
Expand Down Expand Up @@ -376,7 +385,7 @@ def _get_face_classifier(self):
def _pil_to_opencv(self):
mono = self.img.convert("L")
cvim = cv.CreateImageHeader(mono.size, cv.IPL_DEPTH_8U, 1)
cv.SetData(cvim, mono.tostring(), mono.size[0])
cv.SetData(cvim, mono.tobytes(), mono.size[0])
cv.EqualizeHist(cvim, cvim)
return cvim

Expand Down
Binary file modified pilbox/test/data/expected/test5-100x200-mode=clip.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pilbox/test/data/expected/test5-100x200-mode=scale.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pilbox/test/data/expected/test5-300x300-mode=clip.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pilbox/test/data/expected/test5-300x300-mode=scale.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pilbox/test/data/expected/test5-400x300-mode=clip.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pilbox/test/data/expected/test5-400x300-mode=scale.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions provisioning/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
version={{ item.version }}
use_mirrors=yes
with_items:
- { name: 'Pillow', version: '2.8.1' }
- { name: 'tornado', version: '4.0.2' }
- { name: 'Pillow', version: '2.9.0' }
- { name: 'tornado', version: '4.5.1' }
- { name: 'coverage', version: '3.6' }
- { name: 'pep8', version: '1.6.2' }
- { name: 'pyflakes', version: '0.8.1' }
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def run(self):


setup(name='pilbox',
version='1.2.3',
version='1.3.0',
description='Pilbox is an image processing application server built on the Tornado web framework using the Pillow Imaging Library',
long_description=readme,
classifiers=[
Expand All @@ -43,8 +43,8 @@ def run(self):
'pilbox': ['frontalface.xml'],
},
install_requires=[
'tornado==4.0.2',
'Pillow==2.8.1',
'tornado==4.5.1',
'Pillow==2.9.0',
'sphinx-me==0.2.1',
],
extras_require = {
Expand Down

0 comments on commit c93f990

Please sign in to comment.