mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-11 16:52:29 +03:00
Fix for ZeroDivisionError in ImageOps.fit for image.size == (1,1)
This commit is contained in:
parent
97f6d88d01
commit
c9faa9caa5
|
@ -274,6 +274,10 @@ def fit(image, size, method=Image.NEAREST, bleed=0.0, centering=(0.5, 0.5)):
|
||||||
# kevin@cazabon.com
|
# kevin@cazabon.com
|
||||||
# http://www.cazabon.com
|
# http://www.cazabon.com
|
||||||
|
|
||||||
|
# No cropping/fit possible
|
||||||
|
if image.size == (1,1):
|
||||||
|
return image
|
||||||
|
|
||||||
# ensure inputs are valid
|
# ensure inputs are valid
|
||||||
if not isinstance(centering, list):
|
if not isinstance(centering, list):
|
||||||
centering = [centering[0], centering[1]]
|
centering = [centering[0], centering[1]]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user