diff --git a/captcha/image.py b/captcha/image.py index 3a5c80f..90496d9 100644 --- a/captcha/image.py +++ b/captcha/image.py @@ -210,6 +210,9 @@ class ImageCaptcha(_Captcha): image.paste(im, (offset, int((self._height - h) / 2)), mask) offset = offset + w + random.randint(-rand, 0) + if width > self._width: + image = image.resize((self._width, self._height)) + return image def generate_image(self, chars):