Fix for ZeroDivisionError in ImageOps.fit for image.size == (1,1)

This commit is contained in:
Peter van Kampen 2013-06-23 12:33:23 +02:00
parent 97f6d88d01
commit c9faa9caa5

View File

@ -274,6 +274,10 @@ def fit(image, size, method=Image.NEAREST, bleed=0.0, centering=(0.5, 0.5)):
# kevin@cazabon.com
# http://www.cazabon.com
# No cropping/fit possible
if image.size == (1,1):
return image
# ensure inputs are valid
if not isinstance(centering, list):
centering = [centering[0], centering[1]]