From 425c59fdbac87717c9f1887d7da10306b947e047 Mon Sep 17 00:00:00 2001 From: surgan12 Date: Wed, 19 Dec 2018 01:07:21 +0530 Subject: [PATCH] updated Image --- src/PIL/Image.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index e8d003154..bf8814f93 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1755,9 +1755,9 @@ class Image(object): def resize(self, size, resample=NEAREST, box=None): """ Returns a resized copy of this image. - + :param size: The requested size in pixels, as a 2-tuple: - (width, height). + (width, height) or an int :(size,size) :param resample: An optional resampling filter. This can be one of :py:attr:`PIL.Image.NEAREST`, :py:attr:`PIL.Image.BOX`, :py:attr:`PIL.Image.BILINEAR`, :py:attr:`PIL.Image.HAMMING`, @@ -1777,6 +1777,9 @@ class Image(object): ): raise ValueError("unknown resampling filter") + if isinstance(size,int): + size = (size,size) + size = tuple(size) if box is None: