diff --git a/PIL/Image.py b/PIL/Image.py index 6d0fe4fc3..964caf0d3 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -1941,7 +1941,9 @@ class _ImageCrop(Image): Image.__init__(self) - x0, y0, x1, y1 = box + # Round to nearest integer, runs int(round(x)) when unpacking + x0, y0, x1, y1 = map(int, map(round, box)) + if x1 < x0: x1 = x0 if y1 < y0: