Fix size comparison for RSS & HTML output.
This was always broken, but somehow worked with Python 2.7 (WTF?). Now that we test with Pillow, this code path runs with Python 3 and throws an error.
This commit is contained in:
parent
78414cb3d7
commit
d5e7690419
2 changed files with 7 additions and 7 deletions
12
.travis.yml
12
.travis.yml
|
@ -3,10 +3,6 @@ python:
|
|||
- "2.7"
|
||||
- "3.3"
|
||||
- "3.4"
|
||||
# whitelist
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
# install libjpeg-dev for Pillow to handle JPEGs
|
||||
before_install:
|
||||
- sudo apt-get update -q -y
|
||||
|
@ -19,5 +15,9 @@ install:
|
|||
- pip install pytest-xdist
|
||||
# command to run tests
|
||||
script: make test PYTESTOPTS="--tb=short -n10"
|
||||
#notifications:
|
||||
# email: false
|
||||
notifications:
|
||||
irc:
|
||||
channels:
|
||||
- "chat.freenode.net#dosage"
|
||||
use_notice: true
|
||||
skip_join: true
|
||||
|
|
|
@ -125,7 +125,7 @@ def getDimensionForImage(filename, maxsize):
|
|||
return None
|
||||
img = Image.open(filename)
|
||||
width, height = img.size
|
||||
if width > maxsize:
|
||||
if width > maxsize[0] or height > maxsize[1]:
|
||||
img.thumbnail(maxsize)
|
||||
out.info("Downscaled display size from %s to %s" % ((width, height), img.size))
|
||||
return img.size
|
||||
|
|
Loading…
Reference in a new issue