def resize(self, image, size):
(width, height, force) = size<EOL>if image.size[<NUM_LIT:0>] > width or image.size[<NUM_LIT:1>] > height:<EOL><INDENT>if force:<EOL><INDENT>return ImageOps.fit(self.image, (width, height), Image.ANTIALIAS)<EOL><DEDENT>else:<EOL><INDENT>thumb = self.image.copy()<EOL>thumb.thumbnail((width, height), Image.ANTIALIAS)<EOL>return thumb<EOL><DEDENT><DEDENT>return image<EOL>
Resizes the image

:param image: The image object
:param size: size is PIL tuple (width, heigth, force) ex: (200,100,True)