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:
Tobias Gruetzmacher 2015-04-21 00:01:23 +02:00
parent 78414cb3d7
commit d5e7690419
2 changed files with 7 additions and 7 deletions

View file

@ -3,10 +3,6 @@ python:
- "2.7" - "2.7"
- "3.3" - "3.3"
- "3.4" - "3.4"
# whitelist
branches:
only:
- master
# install libjpeg-dev for Pillow to handle JPEGs # install libjpeg-dev for Pillow to handle JPEGs
before_install: before_install:
- sudo apt-get update -q -y - sudo apt-get update -q -y
@ -19,5 +15,9 @@ install:
- pip install pytest-xdist - pip install pytest-xdist
# command to run tests # command to run tests
script: make test PYTESTOPTS="--tb=short -n10" script: make test PYTESTOPTS="--tb=short -n10"
#notifications: notifications:
# email: false irc:
channels:
- "chat.freenode.net#dosage"
use_notice: true
skip_join: true

View file

@ -125,7 +125,7 @@ def getDimensionForImage(filename, maxsize):
return None return None
img = Image.open(filename) img = Image.open(filename)
width, height = img.size width, height = img.size
if width > maxsize: if width > maxsize[0] or height > maxsize[1]:
img.thumbnail(maxsize) img.thumbnail(maxsize)
out.info("Downscaled display size from %s to %s" % ((width, height), img.size)) out.info("Downscaled display size from %s to %s" % ((width, height), img.size))
return img.size return img.size