bugfix: division by zero if only width or only height specified

pull/79/head 18.1.5
seebye 5 years ago
parent 45d225b4a8
commit a8ac9c345c

@ -41,7 +41,7 @@ setuptools.setup(
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='18.1.4', # Required
version='18.1.5', # Required
# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:

@ -35,6 +35,9 @@ def load_image(path, upper_bound_size):
mask = None
if upper_bound_size:
upper_bound_size = tuple(
min(size for size in size_pair if size > 0)
for size_pair in zip(upper_bound_size, original_size))
image.draft(None, upper_bound_size)
downscaled = (image.width, image.height) < original_size

Loading…
Cancel
Save