mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 10:16:17 +03:00
Merge pull request #4 from harobed/master
Fix : resize need int values, append int conversion in thumbnail method
This commit is contained in:
commit
b162546f4c
|
@ -1547,8 +1547,8 @@ class Image:
|
||||||
|
|
||||||
# preserve aspect ratio
|
# preserve aspect ratio
|
||||||
x, y = self.size
|
x, y = self.size
|
||||||
if x > size[0]: y = max(y * size[0] / x, 1); x = size[0]
|
if x > size[0]: y = int(max(y * size[0] / x, 1)); x = int(size[0])
|
||||||
if y > size[1]: x = max(x * size[1] / y, 1); y = size[1]
|
if y > size[1]: x = int(max(x * size[1] / y, 1)); y = int(size[1])
|
||||||
size = x, y
|
size = x, y
|
||||||
|
|
||||||
if size == self.size:
|
if size == self.size:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user