Skip to content

Commit

Permalink
Merge pull request python-pillow#4 from harobed/master
Browse files Browse the repository at this point in the history
Fix : resize need int values, append int conversion in thumbnail method
  • Loading branch information
aclark4life committed Jul 21, 2011
2 parents bf59b22 + c144108 commit b162546
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1547,8 +1547,8 @@ def thumbnail(self, size, resample=NEAREST):

# preserve aspect ratio
x, y = self.size
if x > size[0]: y = max(y * size[0] / x, 1); x = size[0]
if y > size[1]: x = max(x * size[1] / y, 1); y = size[1]
if x > size[0]: y = int(max(y * size[0] / x, 1)); x = int(size[0])
if y > size[1]: x = int(max(x * size[1] / y, 1)); y = int(size[1])
size = x, y

if size == self.size:
Expand Down

0 comments on commit b162546

Please sign in to comment.